31 #define MCS_MODE_SIR 0
32 #define MCS_MODE_MIR 1
33 #define MCS_MODE_FIR 2
35 #define MCS_CTRL_TIMEOUT 500
36 #define MCS_XMIT_TIMEOUT 500
38 #define MCS_TSC_VISHAY 0
39 #define MCS_TSC_AGILENT 1
40 #define MCS_TSC_SHARP 2
43 #define MCS_RD_RTYPE 0xC0
44 #define MCS_WR_RTYPE 0x40
45 #define MCS_RDREQ 0x0F
46 #define MCS_WRREQ 0x0E
49 #define MCS_MODE_REG 0
50 #define MCS_FIR ((__u16)0x0001)
51 #define MCS_SIR16US ((__u16)0x0002)
52 #define MCS_BBTG ((__u16)0x0004)
53 #define MCS_ASK ((__u16)0x0008)
54 #define MCS_PARITY ((__u16)0x0010)
57 #define MCS_SPEED_SHIFT 5
58 #define MCS_SPEED_MASK ((__u16)0x00E0)
59 #define MCS_SPEED(x) ((x & MCS_SPEED_MASK) >> MCS_SPEED_SHIFT)
60 #define MCS_SPEED_2400 ((0 << MCS_SPEED_SHIFT) & MCS_SPEED_MASK)
61 #define MCS_SPEED_9600 ((1 << MCS_SPEED_SHIFT) & MCS_SPEED_MASK)
62 #define MCS_SPEED_19200 ((2 << MCS_SPEED_SHIFT) & MCS_SPEED_MASK)
63 #define MCS_SPEED_38400 ((3 << MCS_SPEED_SHIFT) & MCS_SPEED_MASK)
64 #define MCS_SPEED_57600 ((4 << MCS_SPEED_SHIFT) & MCS_SPEED_MASK)
65 #define MCS_SPEED_115200 ((5 << MCS_SPEED_SHIFT) & MCS_SPEED_MASK)
66 #define MCS_SPEED_576000 ((6 << MCS_SPEED_SHIFT) & MCS_SPEED_MASK)
67 #define MCS_SPEED_1152000 ((7 << MCS_SPEED_SHIFT) & MCS_SPEED_MASK)
69 #define MCS_PLLPWDN ((__u16)0x0100)
70 #define MCS_DRIVER ((__u16)0x0200)
71 #define MCS_DTD ((__u16)0x0400)
72 #define MCS_DIR ((__u16)0x0800)
73 #define MCS_SIPEN ((__u16)0x1000)
74 #define MCS_SENDSIP ((__u16)0x2000)
75 #define MCS_CHGDIR ((__u16)0x4000)
76 #define MCS_RESET ((__u16)0x8000)
79 #define MCS_XCVR_REG 2
80 #define MCS_MODE0 ((__u16)0x0001)
81 #define MCS_STFIR ((__u16)0x0002)
82 #define MCS_XCVR_CONF ((__u16)0x0004)
83 #define MCS_RXFAST ((__u16)0x0008)
85 #define MCS_TXCUR_SHIFT 4
86 #define MCS_TXCUR_MASK ((__u16)0x0070)
87 #define MCS_TXCUR(x) ((x & MCS_TXCUR_MASK) >> MCS_TXCUR_SHIFT)
88 #define MCS_SETTXCUR(x,y) \
89 ((x & ~MCS_TXCUR_MASK) | (y << MCS_TXCUR_SHIFT) & MCS_TXCUR_MASK)
91 #define MCS_MODE1 ((__u16)0x0080)
92 #define MCS_SMODE0 ((__u16)0x0100)
93 #define MCS_SMODE1 ((__u16)0x0200)
94 #define MCS_INVTX ((__u16)0x0400)
95 #define MCS_INVRX ((__u16)0x0800)
97 #define MCS_MINRXPW_REG 4
99 #define MCS_RESV_REG 7
100 #define MCS_IRINTX ((__u16)0x0001)
101 #define MCS_IRINRX ((__u16)0x0002)
137 static inline int mcs_setup_transceiver_vishay(
struct mcs_cb *
mcs);
138 static inline int mcs_setup_transceiver_agilent(
struct mcs_cb *
mcs);
139 static inline int mcs_setup_transceiver_sharp(
struct mcs_cb *
mcs);
140 static inline int mcs_setup_transceiver(
struct mcs_cb *
mcs);
146 static inline int mcs_setup_urbs(
struct mcs_cb *
mcs);
147 static inline int mcs_receive_start(
struct mcs_cb *
mcs);
148 static inline int mcs_find_endpoints(
struct mcs_cb *
mcs,
149 struct usb_host_endpoint *ep,
int epnum);
151 static int mcs_speed_change(
struct mcs_cb *
mcs);
154 static int mcs_net_close(
struct net_device *netdev);
155 static int mcs_net_open(
struct net_device *netdev);
157 static void mcs_receive_irq(
struct urb *
urb);
158 static void mcs_send_irq(
struct urb *
urb);