Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
xirc2ps_cs.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/in.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <linux/bitops.h>
#include <linux/mii.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ciscode.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <pcmcia/ds.h>

Go to the source code of this file.

Data Structures

struct  local_info_t
 
struct  set_address_info
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define MANFID_COMPAQ   0x0138
 
#define MANFID_COMPAQ2   0x0183 /* is this correct? */
 
#define TX_TIMEOUT   ((400*HZ)/1000)
 
#define XIRCREG_CR   0 /* Command register (wr) */
 
#define XIRCREG_ESR   0 /* Ethernet status register (rd) */
 
#define XIRCREG_PR   1 /* Page Register select */
 
#define XIRCREG_EDP   4 /* Ethernet Data Port Register */
 
#define XIRCREG_ISR   6 /* Ethernet Interrupt Status Register */
 
#define XIRCREG1_IMR0   12 /* Ethernet Interrupt Mask Register (on page 1)*/
 
#define XIRCREG1_IMR1   13
 
#define XIRCREG0_TSO   8 /* Transmit Space Open Register (on page 0)*/
 
#define XIRCREG0_TRS   10 /* Transmit reservation Size Register (page 0)*/
 
#define XIRCREG0_DO   12 /* Data Offset Register (page 0) (wr) */
 
#define XIRCREG0_RSR   12 /* Receive Status Register (page 0) (rd) */
 
#define XIRCREG0_PTR   13 /* packets transmitted register (rd) */
 
#define XIRCREG0_RBC   14 /* receive byte count regsister (rd) */
 
#define XIRCREG1_ECR   14 /* ethernet configurationn register */
 
#define XIRCREG2_RBS   8 /* receive buffer start register */
 
#define XIRCREG2_LED   10 /* LED Configuration register */
 
#define XIRCREG2_MSR   12 /* Mohawk specific register */
 
#define XIRCREG4_GPR0   8 /* General Purpose Register 0 */
 
#define XIRCREG4_GPR1   9 /* General Purpose Register 1 */
 
#define XIRCREG2_GPR2   13 /* General Purpose Register 2 (page2!)*/
 
#define XIRCREG4_BOV   10 /* Bonding Version Register */
 
#define XIRCREG4_LMA   12 /* Local Memory Address Register */
 
#define XIRCREG4_LMD   14 /* Local Memory Data Port */
 
#define XIRCREG40_CMD0   8 /* Command Register (wr) */
 
#define XIRCREG5_RHSA0   10 /* Rx Host Start Address */
 
#define XIRCREG40_RXST0   9 /* Receive Status Register */
 
#define XIRCREG40_TXST0   11 /* Transmit Status Register 0 */
 
#define XIRCREG40_TXST1   12 /* Transmit Status Register 10 */
 
#define XIRCREG40_RMASK0   13 /* Receive Mask Register */
 
#define XIRCREG40_TMASK0   14 /* Transmit Mask Register 0 */
 
#define XIRCREG40_TMASK1   15 /* Transmit Mask Register 0 */
 
#define XIRCREG42_SWC0   8 /* Software Configuration 0 */
 
#define XIRCREG42_SWC1   9 /* Software Configuration 1 */
 
#define XIRCREG42_BOC   10 /* Back-Off Configuration */
 
#define XIRCREG44_TDR0   8 /* Time Domain Reflectometry 0 */
 
#define XIRCREG44_TDR1   9 /* Time Domain Reflectometry 1 */
 
#define XIRCREG44_RXBC_LO   10 /* Rx Byte Count 0 (rd) */
 
#define XIRCREG44_RXBC_HI   11 /* Rx Byte Count 1 (rd) */
 
#define XIRCREG45_REV   15 /* Revision Register (rd) */
 
#define XIRCREG50_IA   8 /* Individual Address (8-13) */
 
#define XIR_UNKNOWN   0 /* unknown: not supported */
 
#define XIR_CE   1 /* (prodid 1) different hardware: not supported */
 
#define XIR_CE2   2 /* (prodid 2) */
 
#define XIR_CE3   3 /* (prodid 3) */
 
#define XIR_CEM   4 /* (prodid 1) different hardware: not supported */
 
#define XIR_CEM2   5 /* (prodid 2) */
 
#define XIR_CEM3   6 /* (prodid 3) */
 
#define XIR_CEM33   7 /* (prodid 4) */
 
#define XIR_CEM56M   8 /* (prodid 5) */
 
#define XIR_CEM56   9 /* (prodid 6) */
 
#define XIR_CM28   10 /* (prodid 3) modem only: not supported here */
 
#define XIR_CM33   11 /* (prodid 4) modem only: not supported here */
 
#define XIR_CM56   12 /* (prodid 5) modem only: not supported here */
 
#define XIR_CG   13 /* (prodid 1) GSM modem only: not supported */
 
#define XIR_CBE   14 /* (prodid 1) cardbus ethernet: not supported */
 
#define INT_MODULE_PARM(n, v)   static int n = v; module_param(n, int, 0)
 
#define SelectPage(pgnr)   outb((pgnr), ioaddr + XIRCREG_PR)
 
#define GetByte(reg)   ((unsigned)inb(ioaddr + (reg)))
 
#define GetWord(reg)   ((unsigned)inw(ioaddr + (reg)))
 
#define PutByte(reg, value)   outb((value), ioaddr+(reg))
 
#define PutWord(reg, value)   outw((value), ioaddr+(reg))
 
#define MAYBE_SET(X, Y)   if (ints[0] >= Y && ints[Y] != -1) { X = ints[Y]; }
 

Typedefs

typedef struct local_info_t local_info_t
 

Enumerations

enum  xirc_cr {
  TransmitPacket = 0x01, SoftReset = 0x02, EnableIntr = 0x04, ForceIntr = 0x08,
  ClearTxFIFO = 0x10, ClearRxOvrun = 0x20, RestartTx = 0x40
}
 
enum  xirc_esr {
  FullPktRcvd = 0x01, PktRejected = 0x04, TxPktPend = 0x08, IncorPolarity = 0x10,
  MediaSelect = 0x20
}
 
enum  xirc_isr {
  TxBufOvr = 0x01, PktTxed = 0x02, MACIntr = 0x04, TxResGrant = 0x08,
  RxFullPkt = 0x20, RxPktRej = 0x40, ForcedIntr = 0x80
}
 
enum  xirc_rsr {
  PhyPkt = 0x01, BrdcstPkt = 0x02, PktTooLong = 0x04, AlignErr = 0x10,
  CRCErr = 0x20, PktRxOk = 0x80
}
 
enum  xirc_ecr {
  FullDuplex = 0x04, LongTPMode = 0x08, DisablePolCor = 0x10, DisableLinkPulse = 0x20,
  DisableAutoTx = 0x40
}
 
enum  xirc_cmd {
  Transmit = 0x01, EnableRecv = 0x04, DisableRecv = 0x08, Abort = 0x10,
  Online = 0x20, IntrAck = 0x40, Offline = 0x80
}
 

Functions

 MODULE_DESCRIPTION ("Xircom PCMCIA ethernet driver")
 
 MODULE_LICENSE ("Dual MPL/GPL")
 
 INT_MODULE_PARM (if_port, 0)
 
 INT_MODULE_PARM (full_duplex, 0)
 
 INT_MODULE_PARM (do_sound, 1)
 
 INT_MODULE_PARM (lockup_hack, 0)
 
 MODULE_DEVICE_TABLE (pcmcia, xirc2ps_ids)
 
 module_init (init_xirc2ps_cs)
 
 module_exit (exit_xirc2ps_cs)
 
 __setup ("xirc2ps_cs=", setup_xirc2ps_cs)
 

Macro Definition Documentation

#define GetByte (   reg)    ((unsigned)inb(ioaddr + (reg)))

Definition at line 309 of file xirc2ps_cs.c.

#define GetWord (   reg)    ((unsigned)inw(ioaddr + (reg)))

Definition at line 310 of file xirc2ps_cs.c.

#define INT_MODULE_PARM (   n,
  v 
)    static int n = v; module_param(n, int, 0)

Definition at line 236 of file xirc2ps_cs.c.

#define MANFID_COMPAQ   0x0138

Definition at line 95 of file xirc2ps_cs.c.

#define MANFID_COMPAQ2   0x0183 /* is this correct? */

Definition at line 96 of file xirc2ps_cs.c.

#define MAYBE_SET (   X,
 
)    if (ints[0] >= Y && ints[Y] != -1) { X = ints[Y]; }
#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 66 of file xirc2ps_cs.c.

#define PutByte (   reg,
  value 
)    outb((value), ioaddr+(reg))

Definition at line 311 of file xirc2ps_cs.c.

#define PutWord (   reg,
  value 
)    outw((value), ioaddr+(reg))

Definition at line 312 of file xirc2ps_cs.c.

#define SelectPage (   pgnr)    outb((pgnr), ioaddr + XIRCREG_PR)

Definition at line 308 of file xirc2ps_cs.c.

#define TX_TIMEOUT   ((400*HZ)/1000)

Definition at line 102 of file xirc2ps_cs.c.

#define XIR_CBE   14 /* (prodid 1) cardbus ethernet: not supported */

Definition at line 228 of file xirc2ps_cs.c.

#define XIR_CE   1 /* (prodid 1) different hardware: not supported */

Definition at line 215 of file xirc2ps_cs.c.

#define XIR_CE2   2 /* (prodid 2) */

Definition at line 216 of file xirc2ps_cs.c.

#define XIR_CE3   3 /* (prodid 3) */

Definition at line 217 of file xirc2ps_cs.c.

#define XIR_CEM   4 /* (prodid 1) different hardware: not supported */

Definition at line 218 of file xirc2ps_cs.c.

#define XIR_CEM2   5 /* (prodid 2) */

Definition at line 219 of file xirc2ps_cs.c.

#define XIR_CEM3   6 /* (prodid 3) */

Definition at line 220 of file xirc2ps_cs.c.

#define XIR_CEM33   7 /* (prodid 4) */

Definition at line 221 of file xirc2ps_cs.c.

#define XIR_CEM56   9 /* (prodid 6) */

Definition at line 223 of file xirc2ps_cs.c.

#define XIR_CEM56M   8 /* (prodid 5) */

Definition at line 222 of file xirc2ps_cs.c.

#define XIR_CG   13 /* (prodid 1) GSM modem only: not supported */

Definition at line 227 of file xirc2ps_cs.c.

#define XIR_CM28   10 /* (prodid 3) modem only: not supported here */

Definition at line 224 of file xirc2ps_cs.c.

#define XIR_CM33   11 /* (prodid 4) modem only: not supported here */

Definition at line 225 of file xirc2ps_cs.c.

#define XIR_CM56   12 /* (prodid 5) modem only: not supported here */

Definition at line 226 of file xirc2ps_cs.c.

#define XIR_UNKNOWN   0 /* unknown: not supported */

Definition at line 214 of file xirc2ps_cs.c.

#define XIRCREG0_DO   12 /* Data Offset Register (page 0) (wr) */

Definition at line 143 of file xirc2ps_cs.c.

#define XIRCREG0_PTR   13 /* packets transmitted register (rd) */

Definition at line 153 of file xirc2ps_cs.c.

#define XIRCREG0_RBC   14 /* receive byte count regsister (rd) */

Definition at line 154 of file xirc2ps_cs.c.

#define XIRCREG0_RSR   12 /* Receive Status Register (page 0) (rd) */

Definition at line 144 of file xirc2ps_cs.c.

#define XIRCREG0_TRS   10 /* Transmit reservation Size Register (page 0)*/

Definition at line 142 of file xirc2ps_cs.c.

#define XIRCREG0_TSO   8 /* Transmit Space Open Register (on page 0)*/

Definition at line 141 of file xirc2ps_cs.c.

#define XIRCREG1_ECR   14 /* ethernet configurationn register */

Definition at line 155 of file xirc2ps_cs.c.

#define XIRCREG1_IMR0   12 /* Ethernet Interrupt Mask Register (on page 1)*/

Definition at line 139 of file xirc2ps_cs.c.

#define XIRCREG1_IMR1   13

Definition at line 140 of file xirc2ps_cs.c.

#define XIRCREG2_GPR2   13 /* General Purpose Register 2 (page2!)*/

Definition at line 179 of file xirc2ps_cs.c.

#define XIRCREG2_LED   10 /* LED Configuration register */

Definition at line 164 of file xirc2ps_cs.c.

#define XIRCREG2_MSR   12 /* Mohawk specific register */

Definition at line 175 of file xirc2ps_cs.c.

#define XIRCREG2_RBS   8 /* receive buffer start register */

Definition at line 163 of file xirc2ps_cs.c.

#define XIRCREG40_CMD0   8 /* Command Register (wr) */

Definition at line 184 of file xirc2ps_cs.c.

#define XIRCREG40_RMASK0   13 /* Receive Mask Register */

Definition at line 198 of file xirc2ps_cs.c.

#define XIRCREG40_RXST0   9 /* Receive Status Register */

Definition at line 195 of file xirc2ps_cs.c.

#define XIRCREG40_TMASK0   14 /* Transmit Mask Register 0 */

Definition at line 199 of file xirc2ps_cs.c.

#define XIRCREG40_TMASK1   15 /* Transmit Mask Register 0 */

Definition at line 200 of file xirc2ps_cs.c.

#define XIRCREG40_TXST0   11 /* Transmit Status Register 0 */

Definition at line 196 of file xirc2ps_cs.c.

#define XIRCREG40_TXST1   12 /* Transmit Status Register 10 */

Definition at line 197 of file xirc2ps_cs.c.

#define XIRCREG42_BOC   10 /* Back-Off Configuration */

Definition at line 203 of file xirc2ps_cs.c.

#define XIRCREG42_SWC0   8 /* Software Configuration 0 */

Definition at line 201 of file xirc2ps_cs.c.

#define XIRCREG42_SWC1   9 /* Software Configuration 1 */

Definition at line 202 of file xirc2ps_cs.c.

#define XIRCREG44_RXBC_HI   11 /* Rx Byte Count 1 (rd) */

Definition at line 207 of file xirc2ps_cs.c.

#define XIRCREG44_RXBC_LO   10 /* Rx Byte Count 0 (rd) */

Definition at line 206 of file xirc2ps_cs.c.

#define XIRCREG44_TDR0   8 /* Time Domain Reflectometry 0 */

Definition at line 204 of file xirc2ps_cs.c.

#define XIRCREG44_TDR1   9 /* Time Domain Reflectometry 1 */

Definition at line 205 of file xirc2ps_cs.c.

#define XIRCREG45_REV   15 /* Revision Register (rd) */

Definition at line 208 of file xirc2ps_cs.c.

#define XIRCREG4_BOV   10 /* Bonding Version Register */

Definition at line 180 of file xirc2ps_cs.c.

#define XIRCREG4_GPR0   8 /* General Purpose Register 0 */

Definition at line 177 of file xirc2ps_cs.c.

#define XIRCREG4_GPR1   9 /* General Purpose Register 1 */

Definition at line 178 of file xirc2ps_cs.c.

#define XIRCREG4_LMA   12 /* Local Memory Address Register */

Definition at line 181 of file xirc2ps_cs.c.

#define XIRCREG4_LMD   14 /* Local Memory Data Port */

Definition at line 182 of file xirc2ps_cs.c.

#define XIRCREG50_IA   8 /* Individual Address (8-13) */

Definition at line 209 of file xirc2ps_cs.c.

#define XIRCREG5_RHSA0   10 /* Rx Host Start Address */

Definition at line 194 of file xirc2ps_cs.c.

#define XIRCREG_CR   0 /* Command register (wr) */

Definition at line 109 of file xirc2ps_cs.c.

#define XIRCREG_EDP   4 /* Ethernet Data Port Register */

Definition at line 128 of file xirc2ps_cs.c.

#define XIRCREG_ESR   0 /* Ethernet status register (rd) */

Definition at line 119 of file xirc2ps_cs.c.

#define XIRCREG_ISR   6 /* Ethernet Interrupt Status Register */

Definition at line 129 of file xirc2ps_cs.c.

#define XIRCREG_PR   1 /* Page Register select */

Definition at line 127 of file xirc2ps_cs.c.

Typedef Documentation

Enumeration Type Documentation

enum xirc_cmd
Enumerator:
Transmit 
EnableRecv 
DisableRecv 
Abort 
Online 
IntrAck 
Offline 

Definition at line 185 of file xirc2ps_cs.c.

enum xirc_cr
Enumerator:
TransmitPacket 
SoftReset 
EnableIntr 
ForceIntr 
ClearTxFIFO 
ClearRxOvrun 
RestartTx 

Definition at line 110 of file xirc2ps_cs.c.

enum xirc_ecr
Enumerator:
FullDuplex 
LongTPMode 
DisablePolCor 
DisableLinkPulse 
DisableAutoTx 

Definition at line 156 of file xirc2ps_cs.c.

enum xirc_esr
Enumerator:
FullPktRcvd 
PktRejected 
TxPktPend 
IncorPolarity 
MediaSelect 

Definition at line 120 of file xirc2ps_cs.c.

enum xirc_isr
Enumerator:
TxBufOvr 
PktTxed 
MACIntr 
TxResGrant 
RxFullPkt 
RxPktRej 
ForcedIntr 

Definition at line 130 of file xirc2ps_cs.c.

enum xirc_rsr
Enumerator:
PhyPkt 
BrdcstPkt 
PktTooLong 
AlignErr 
CRCErr 
PktRxOk 

Definition at line 145 of file xirc2ps_cs.c.

Function Documentation

__setup ( )
INT_MODULE_PARM ( if_port  ,
 
)
INT_MODULE_PARM ( full_duplex  ,
 
)
INT_MODULE_PARM ( do_sound  ,
 
)
INT_MODULE_PARM ( lockup_hack  ,
 
)
MODULE_DESCRIPTION ( "Xircom PCMCIA ethernet driver )
MODULE_DEVICE_TABLE ( pcmcia  ,
xirc2ps_ids   
)
module_exit ( exit_xirc2ps_cs  )
module_init ( init_xirc2ps_cs  )
MODULE_LICENSE ( "Dual MPL/GPL"  )