Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dscc4.c File Reference
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/list.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <asm/cache.h>
#include <asm/byteorder.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/string.h>
#include <linux/if_arp.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/hdlc.h>
#include <linux/mutex.h>

Go to the source code of this file.

Data Structures

struct  thingie
 
struct  TxFD
 
struct  RxFD
 
struct  dscc4_pci_priv
 
struct  dscc4_dev_priv
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRV_NAME   "dscc4"
 
#define DUMMY_SKB_SIZE   64
 
#define TX_LOW   8
 
#define TX_RING_SIZE   32
 
#define RX_RING_SIZE   32
 
#define TX_TOTAL_SIZE   TX_RING_SIZE*sizeof(struct TxFD)
 
#define RX_TOTAL_SIZE   RX_RING_SIZE*sizeof(struct RxFD)
 
#define IRQ_RING_SIZE   64 /* Keep it a multiple of 32 */
 
#define TX_TIMEOUT   (HZ/10)
 
#define DSCC4_HZ_MAX   33000000
 
#define BRR_DIVIDER_MAX   64*0x00004000 /* Cf errata DS5 p.10 */
 
#define dev_per_card   4
 
#define SCC_REGISTERS_MAX   23 /* Cf errata DS5 p.4 */
 
#define SOURCE_ID(flags)   (((flags) >> 28) & 0x03)
 
#define TO_SIZE(state)   (((state) >> 16) & 0x1fff)
 
#define TO_STATE_TX(len)   cpu_to_le32(((len) & TxSizeMax) << 16)
 
#define TO_STATE_RX(len)   cpu_to_le32((RX_MAX(len) % RxSizeMax) << 16)
 
#define RX_MAX(len)   ((((len) >> 5) + 1) << 5) /* Cf RLCR */
 
#define SCC_REG_START(dpriv)   (SCC_START+(dpriv->dev_id)*SCC_OFFSET)
 
#define GCMDR   0x00
 
#define GSTAR   0x04
 
#define GMODE   0x08
 
#define IQLENR0   0x0C
 
#define IQLENR1   0x10
 
#define IQRX0   0x14
 
#define IQTX0   0x24
 
#define IQCFG   0x3c
 
#define FIFOCR1   0x44
 
#define FIFOCR2   0x48
 
#define FIFOCR3   0x4c
 
#define FIFOCR4   0x34
 
#define CH0CFG   0x50
 
#define CH0BRDA   0x54
 
#define CH0BTDA   0x58
 
#define CH0FRDA   0x98
 
#define CH0FTDA   0xb0
 
#define CH0LRDA   0xc8
 
#define CH0LTDA   0xe0
 
#define SCC_START   0x0100
 
#define SCC_OFFSET   0x80
 
#define CMDR   0x00
 
#define STAR   0x04
 
#define CCR0   0x08
 
#define CCR1   0x0c
 
#define CCR2   0x10
 
#define BRR   0x2C
 
#define RLCR   0x40
 
#define IMR   0x54
 
#define ISR   0x58
 
#define GPDIR   0x0400
 
#define GPDATA   0x0404
 
#define GPIM   0x0408
 
#define EncodingMask   0x00700000
 
#define CrcMask   0x00000003
 
#define IntRxScc0   0x10000000
 
#define IntTxScc0   0x01000000
 
#define TxPollCmd   0x00000400
 
#define RxActivate   0x08000000
 
#define MTFi   0x04000000
 
#define Rdr   0x00400000
 
#define Rdt   0x00200000
 
#define Idr   0x00100000
 
#define Idt   0x00080000
 
#define TxSccRes   0x01000000
 
#define RxSccRes   0x00010000
 
#define TxSizeMax   0x1fff /* Datasheet DS1 - 11.1.1.1 */
 
#define RxSizeMax   0x1ffc /* Datasheet DS1 - 11.1.2.1 */
 
#define Ccr0ClockMask   0x0000003f
 
#define Ccr1LoopMask   0x00000200
 
#define IsrMask   0x000fffff
 
#define BrrExpMask   0x00000f00
 
#define BrrMultMask   0x0000003f
 
#define EncodingMask   0x00700000
 
#define Hold   cpu_to_le32(0x40000000)
 
#define SccBusy   0x10000000
 
#define PowerUp   0x80000000
 
#define Vis   0x00001000
 
#define FrameOk   (FrameVfr | FrameCrc)
 
#define FrameVfr   0x80
 
#define FrameRdo   0x40
 
#define FrameCrc   0x20
 
#define FrameRab   0x10
 
#define FrameAborted   cpu_to_le32(0x00000200)
 
#define FrameEnd   cpu_to_le32(0x80000000)
 
#define DataComplete   cpu_to_le32(0x40000000)
 
#define LengthCheck   0x00008000
 
#define SccEvt   0x02000000
 
#define NoAck   0x00000200
 
#define Action   0x00000001
 
#define HiDesc   cpu_to_le32(0x20000000)
 
#define RxEvt   0xf0000000
 
#define TxEvt   0x0f000000
 
#define Alls   0x00040000
 
#define Xdu   0x00010000
 
#define Cts   0x00004000
 
#define Xmr   0x00002000
 
#define Xpr   0x00001000
 
#define Rdo   0x00000080
 
#define Rfs   0x00000040
 
#define Cd   0x00000004
 
#define Rfo   0x00000002
 
#define Flex   0x00000001
 
#define Cfg   0x00200000
 
#define Hi   0x00040000
 
#define Fi   0x00020000
 
#define Err   0x00010000
 
#define Arf   0x00000002
 
#define ArAck   0x00000001
 
#define Ready   0x00000000
 
#define NeedIDR   0x00000001
 
#define NeedIDT   0x00000002
 
#define RdoSet   0x00000004
 
#define FakeReset   0x00000008
 
#define EventsMask   0xfffa8f7a
 
#define dscc4_pci_reset(pdev, ioaddr)   do {} while (0)
 

Functions

 MODULE_AUTHOR ("Maintainer: Francois Romieu <[email protected]>")
 
 MODULE_DESCRIPTION ("Siemens PEB20534 PCI Controller")
 
 MODULE_LICENSE ("GPL")
 
 module_param (debug, int, 0)
 
 MODULE_PARM_DESC (debug,"Enable/disable extra messages")
 
 module_param (quartz, int, 0)
 
 MODULE_PARM_DESC (quartz,"If present, on-board quartz frequency (Hz)")
 
 __setup ("dscc4.setup=", dscc4_setup)
 
 MODULE_DEVICE_TABLE (pci, dscc4_pci_tbl)
 
 module_pci_driver (dscc4_driver)
 

Macro Definition Documentation

__le32 Action   0x00000001

Definition at line 321 of file dscc4.c.

#define Alls   0x00040000

Definition at line 327 of file dscc4.c.

#define ArAck   0x00000001

Definition at line 344 of file dscc4.c.

#define Arf   0x00000002

Definition at line 343 of file dscc4.c.

#define BRR   0x2C

Definition at line 272 of file dscc4.c.

#define BRR_DIVIDER_MAX   64*0x00004000 /* Cf errata DS5 p.10 */

Definition at line 171 of file dscc4.c.

#define BrrExpMask   0x00000f00

Definition at line 303 of file dscc4.c.

#define BrrMultMask   0x0000003f

Definition at line 304 of file dscc4.c.

#define CCR0   0x08

Definition at line 269 of file dscc4.c.

#define Ccr0ClockMask   0x0000003f

Definition at line 300 of file dscc4.c.

#define CCR1   0x0c

Definition at line 270 of file dscc4.c.

#define Ccr1LoopMask   0x00000200

Definition at line 301 of file dscc4.c.

#define CCR2   0x10

Definition at line 271 of file dscc4.c.

#define Cd   0x00000004

Definition at line 334 of file dscc4.c.

#define Cfg   0x00200000

Definition at line 339 of file dscc4.c.

#define CH0BRDA   0x54

Definition at line 257 of file dscc4.c.

#define CH0BTDA   0x58

Definition at line 258 of file dscc4.c.

#define CH0CFG   0x50

Definition at line 256 of file dscc4.c.

#define CH0FRDA   0x98

Definition at line 259 of file dscc4.c.

#define CH0FTDA   0xb0

Definition at line 260 of file dscc4.c.

#define CH0LRDA   0xc8

Definition at line 261 of file dscc4.c.

#define CH0LTDA   0xe0

Definition at line 262 of file dscc4.c.

#define CMDR   0x00

Definition at line 267 of file dscc4.c.

#define CrcMask   0x00000003

Definition at line 283 of file dscc4.c.

#define Cts   0x00004000

Definition at line 329 of file dscc4.c.

#define DataComplete   cpu_to_le32(0x40000000)

Definition at line 317 of file dscc4.c.

#define dev_per_card   4

Definition at line 172 of file dscc4.c.

#define DRV_NAME   "dscc4"

Definition at line 123 of file dscc4.c.

#define DSCC4_HZ_MAX   33000000

Definition at line 170 of file dscc4.c.

#define dscc4_pci_reset (   pdev,
  ioaddr 
)    do {} while (0)

Definition at line 1046 of file dscc4.c.

#define DUMMY_SKB_SIZE   64

Definition at line 162 of file dscc4.c.

#define EncodingMask   0x00700000

Definition at line 305 of file dscc4.c.

#define EncodingMask   0x00700000

Definition at line 305 of file dscc4.c.

#define Err   0x00010000

Definition at line 342 of file dscc4.c.

#define EventsMask   0xfffa8f7a

Definition at line 357 of file dscc4.c.

#define FakeReset   0x00000008

Definition at line 351 of file dscc4.c.

#define Fi   0x00020000

Definition at line 341 of file dscc4.c.

#define FIFOCR1   0x44

Definition at line 252 of file dscc4.c.

#define FIFOCR2   0x48

Definition at line 253 of file dscc4.c.

#define FIFOCR3   0x4c

Definition at line 254 of file dscc4.c.

#define FIFOCR4   0x34

Definition at line 255 of file dscc4.c.

#define Flex   0x00000001

Definition at line 336 of file dscc4.c.

#define FrameAborted   cpu_to_le32(0x00000200)

Definition at line 315 of file dscc4.c.

#define FrameCrc   0x20

Definition at line 313 of file dscc4.c.

#define FrameEnd   cpu_to_le32(0x80000000)

Definition at line 316 of file dscc4.c.

#define FrameOk   (FrameVfr | FrameCrc)

Definition at line 310 of file dscc4.c.

#define FrameRab   0x10

Definition at line 314 of file dscc4.c.

#define FrameRdo   0x40

Definition at line 312 of file dscc4.c.

#define FrameVfr   0x80

Definition at line 311 of file dscc4.c.

#define GCMDR   0x00

Definition at line 244 of file dscc4.c.

#define GMODE   0x08

Definition at line 246 of file dscc4.c.

#define GPDATA   0x0404

Definition at line 278 of file dscc4.c.

#define GPDIR   0x0400

Definition at line 277 of file dscc4.c.

#define GPIM   0x0408

Definition at line 279 of file dscc4.c.

#define GSTAR   0x04

Definition at line 245 of file dscc4.c.

#define Hi   0x00040000

Definition at line 340 of file dscc4.c.

#define HiDesc   cpu_to_le32(0x20000000)

Definition at line 322 of file dscc4.c.

#define Hold   cpu_to_le32(0x40000000)

Definition at line 306 of file dscc4.c.

#define Idr   0x00100000

Definition at line 293 of file dscc4.c.

#define Idt   0x00080000

Definition at line 294 of file dscc4.c.

#define IMR   0x54

Definition at line 274 of file dscc4.c.

#define IntRxScc0   0x10000000

Definition at line 285 of file dscc4.c.

#define IntTxScc0   0x01000000

Definition at line 286 of file dscc4.c.

#define IQCFG   0x3c

Definition at line 251 of file dscc4.c.

#define IQLENR0   0x0C

Definition at line 247 of file dscc4.c.

#define IQLENR1   0x10

Definition at line 248 of file dscc4.c.

#define IQRX0   0x14

Definition at line 249 of file dscc4.c.

#define IQTX0   0x24

Definition at line 250 of file dscc4.c.

#define IRQ_RING_SIZE   64 /* Keep it a multiple of 32 */

Definition at line 168 of file dscc4.c.

#define ISR   0x58

Definition at line 275 of file dscc4.c.

#define IsrMask   0x000fffff

Definition at line 302 of file dscc4.c.

#define LengthCheck   0x00008000

Definition at line 318 of file dscc4.c.

#define MTFi   0x04000000

Definition at line 290 of file dscc4.c.

#define NeedIDR   0x00000001

Definition at line 348 of file dscc4.c.

#define NeedIDT   0x00000002

Definition at line 349 of file dscc4.c.

#define NoAck   0x00000200

Definition at line 320 of file dscc4.c.

#define PowerUp   0x80000000

Definition at line 308 of file dscc4.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 83 of file dscc4.c.

#define Rdo   0x00000080

Definition at line 332 of file dscc4.c.

#define RdoSet   0x00000004

Definition at line 350 of file dscc4.c.

#define Rdr   0x00400000

Definition at line 291 of file dscc4.c.

#define Rdt   0x00200000

Definition at line 292 of file dscc4.c.

#define Ready   0x00000000

Definition at line 347 of file dscc4.c.

#define Rfo   0x00000002

Definition at line 335 of file dscc4.c.

#define Rfs   0x00000040

Definition at line 333 of file dscc4.c.

#define RLCR   0x40

Definition at line 273 of file dscc4.c.

#define RX_MAX (   len)    ((((len) >> 5) + 1) << 5) /* Cf RLCR */

Definition at line 185 of file dscc4.c.

#define RX_RING_SIZE   32

Definition at line 165 of file dscc4.c.

#define RX_TOTAL_SIZE   RX_RING_SIZE*sizeof(struct RxFD)

Definition at line 167 of file dscc4.c.

#define RxActivate   0x08000000

Definition at line 289 of file dscc4.c.

#define RxEvt   0xf0000000

Definition at line 325 of file dscc4.c.

#define RxSccRes   0x00010000

Definition at line 296 of file dscc4.c.

#define RxSizeMax   0x1ffc /* Datasheet DS1 - 11.1.2.1 */

Definition at line 298 of file dscc4.c.

#define SCC_OFFSET   0x80

Definition at line 266 of file dscc4.c.

#define SCC_REG_START (   dpriv)    (SCC_START+(dpriv->dev_id)*SCC_OFFSET)

Definition at line 186 of file dscc4.c.

#define SCC_REGISTERS_MAX   23 /* Cf errata DS5 p.4 */

Definition at line 173 of file dscc4.c.

#define SCC_START   0x0100

Definition at line 265 of file dscc4.c.

#define SccBusy   0x10000000

Definition at line 307 of file dscc4.c.

#define SccEvt   0x02000000

Definition at line 319 of file dscc4.c.

#define SOURCE_ID (   flags)    (((flags) >> 28) & 0x03)

Definition at line 175 of file dscc4.c.

#define STAR   0x04

Definition at line 268 of file dscc4.c.

#define TO_SIZE (   state)    (((state) >> 16) & 0x1fff)

Definition at line 176 of file dscc4.c.

#define TO_STATE_RX (   len)    cpu_to_le32((RX_MAX(len) % RxSizeMax) << 16)

Definition at line 184 of file dscc4.c.

#define TO_STATE_TX (   len)    cpu_to_le32(((len) & TxSizeMax) << 16)

Definition at line 183 of file dscc4.c.

#define TX_LOW   8

Definition at line 163 of file dscc4.c.

#define TX_RING_SIZE   32

Definition at line 164 of file dscc4.c.

#define TX_TIMEOUT   (HZ/10)

Definition at line 169 of file dscc4.c.

#define TX_TOTAL_SIZE   TX_RING_SIZE*sizeof(struct TxFD)

Definition at line 166 of file dscc4.c.

#define TxEvt   0x0f000000

Definition at line 326 of file dscc4.c.

#define TxPollCmd   0x00000400

Definition at line 288 of file dscc4.c.

#define TxSccRes   0x01000000

Definition at line 295 of file dscc4.c.

#define TxSizeMax   0x1fff /* Datasheet DS1 - 11.1.1.1 */

Definition at line 297 of file dscc4.c.

#define Vis   0x00001000

Definition at line 309 of file dscc4.c.

#define Xdu   0x00010000

Definition at line 328 of file dscc4.c.

#define Xmr   0x00002000

Definition at line 330 of file dscc4.c.

#define Xpr   0x00001000

Definition at line 331 of file dscc4.c.

Function Documentation

__setup ( )
MODULE_AUTHOR ( "Maintainer: Francois Romieu <[email protected]>"  )
MODULE_DESCRIPTION ( "Siemens PEB20534 PCI Controller )
MODULE_DEVICE_TABLE ( pci  ,
dscc4_pci_tbl   
)
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
 
)
module_param ( quartz  ,
int  ,
 
)
MODULE_PARM_DESC ( debug  ,
"Enable/disable extra messages"   
)
MODULE_PARM_DESC ( quartz  ,
"If  present,
on-board quartz frequency(Hz)"   
)
module_pci_driver ( dscc4_driver  )