aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/pc300.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan/pc300.h')
-rw-r--r--drivers/net/wan/pc300.h184
1 files changed, 90 insertions, 94 deletions
diff --git a/drivers/net/wan/pc300.h b/drivers/net/wan/pc300.h
index cee799dabd97..2e4f84f6cad4 100644
--- a/drivers/net/wan/pc300.h
+++ b/drivers/net/wan/pc300.h
@@ -103,10 +103,6 @@
103#include "hd64572.h" 103#include "hd64572.h"
104#include "pc300-falc-lh.h" 104#include "pc300-falc-lh.h"
105 105
106typedef __u32 uclong; /* 32 bits, unsigned */
107typedef __u16 ucshort; /* 16 bits, unsigned */
108typedef __u8 ucchar; /* 8 bits, unsigned */
109
110#define PC300_PROTO_MLPPP 1 106#define PC300_PROTO_MLPPP 1
111 107
112#define PC300_MAXCHAN 2 /* Number of channels per card */ 108#define PC300_MAXCHAN 2 /* Number of channels per card */
@@ -147,9 +143,9 @@ typedef __u8 ucchar; /* 8 bits, unsigned */
147 * Memory access functions/macros * 143 * Memory access functions/macros *
148 * (required to support Alpha systems) * 144 * (required to support Alpha systems) *
149 ***************************************/ 145 ***************************************/
150#define cpc_writeb(port,val) {writeb((ucchar)(val),(port)); mb();} 146#define cpc_writeb(port,val) {writeb((u8)(val),(port)); mb();}
151#define cpc_writew(port,val) {writew((ushort)(val),(port)); mb();} 147#define cpc_writew(port,val) {writew((ushort)(val),(port)); mb();}
152#define cpc_writel(port,val) {writel((uclong)(val),(port)); mb();} 148#define cpc_writel(port,val) {writel((u32)(val),(port)); mb();}
153 149
154#define cpc_readb(port) readb(port) 150#define cpc_readb(port) readb(port)
155#define cpc_readw(port) readw(port) 151#define cpc_readw(port) readw(port)
@@ -163,15 +159,15 @@ typedef __u8 ucchar; /* 8 bits, unsigned */
163 * (memory mapped). 159 * (memory mapped).
164 */ 160 */
165struct RUNTIME_9050 { 161struct RUNTIME_9050 {
166 uclong loc_addr_range[4]; /* 00-0Ch : Local Address Ranges */ 162 u32 loc_addr_range[4]; /* 00-0Ch : Local Address Ranges */
167 uclong loc_rom_range; /* 10h : Local ROM Range */ 163 u32 loc_rom_range; /* 10h : Local ROM Range */
168 uclong loc_addr_base[4]; /* 14-20h : Local Address Base Addrs */ 164 u32 loc_addr_base[4]; /* 14-20h : Local Address Base Addrs */
169 uclong loc_rom_base; /* 24h : Local ROM Base */ 165 u32 loc_rom_base; /* 24h : Local ROM Base */
170 uclong loc_bus_descr[4]; /* 28-34h : Local Bus Descriptors */ 166 u32 loc_bus_descr[4]; /* 28-34h : Local Bus Descriptors */
171 uclong rom_bus_descr; /* 38h : ROM Bus Descriptor */ 167 u32 rom_bus_descr; /* 38h : ROM Bus Descriptor */
172 uclong cs_base[4]; /* 3C-48h : Chip Select Base Addrs */ 168 u32 cs_base[4]; /* 3C-48h : Chip Select Base Addrs */
173 uclong intr_ctrl_stat; /* 4Ch : Interrupt Control/Status */ 169 u32 intr_ctrl_stat; /* 4Ch : Interrupt Control/Status */
174 uclong init_ctrl; /* 50h : EEPROM ctrl, Init Ctrl, etc */ 170 u32 init_ctrl; /* 50h : EEPROM ctrl, Init Ctrl, etc */
175}; 171};
176 172
177#define PLX_9050_LINT1_ENABLE 0x01 173#define PLX_9050_LINT1_ENABLE 0x01
@@ -215,66 +211,66 @@ struct RUNTIME_9050 {
215#define PC300_FALC_MAXLOOP 0x0000ffff /* for falc_issue_cmd() */ 211#define PC300_FALC_MAXLOOP 0x0000ffff /* for falc_issue_cmd() */
216 212
217typedef struct falc { 213typedef struct falc {
218 ucchar sync; /* If true FALC is synchronized */ 214 u8 sync; /* If true FALC is synchronized */
219 ucchar active; /* if TRUE then already active */ 215 u8 active; /* if TRUE then already active */
220 ucchar loop_active; /* if TRUE a line loopback UP was received */ 216 u8 loop_active; /* if TRUE a line loopback UP was received */
221 ucchar loop_gen; /* if TRUE a line loopback UP was issued */ 217 u8 loop_gen; /* if TRUE a line loopback UP was issued */
222 218
223 ucchar num_channels; 219 u8 num_channels;
224 ucchar offset; /* 1 for T1, 0 for E1 */ 220 u8 offset; /* 1 for T1, 0 for E1 */
225 ucchar full_bandwidth; 221 u8 full_bandwidth;
226 222
227 ucchar xmb_cause; 223 u8 xmb_cause;
228 ucchar multiframe_mode; 224 u8 multiframe_mode;
229 225
230 /* Statistics */ 226 /* Statistics */
231 ucshort pden; /* Pulse Density violation count */ 227 u16 pden; /* Pulse Density violation count */
232 ucshort los; /* Loss of Signal count */ 228 u16 los; /* Loss of Signal count */
233 ucshort losr; /* Loss of Signal recovery count */ 229 u16 losr; /* Loss of Signal recovery count */
234 ucshort lfa; /* Loss of frame alignment count */ 230 u16 lfa; /* Loss of frame alignment count */
235 ucshort farec; /* Frame Alignment Recovery count */ 231 u16 farec; /* Frame Alignment Recovery count */
236 ucshort lmfa; /* Loss of multiframe alignment count */ 232 u16 lmfa; /* Loss of multiframe alignment count */
237 ucshort ais; /* Remote Alarm indication Signal count */ 233 u16 ais; /* Remote Alarm indication Signal count */
238 ucshort sec; /* One-second timer */ 234 u16 sec; /* One-second timer */
239 ucshort es; /* Errored second */ 235 u16 es; /* Errored second */
240 ucshort rai; /* remote alarm received */ 236 u16 rai; /* remote alarm received */
241 ucshort bec; 237 u16 bec;
242 ucshort fec; 238 u16 fec;
243 ucshort cvc; 239 u16 cvc;
244 ucshort cec; 240 u16 cec;
245 ucshort ebc; 241 u16 ebc;
246 242
247 /* Status */ 243 /* Status */
248 ucchar red_alarm; 244 u8 red_alarm;
249 ucchar blue_alarm; 245 u8 blue_alarm;
250 ucchar loss_fa; 246 u8 loss_fa;
251 ucchar yellow_alarm; 247 u8 yellow_alarm;
252 ucchar loss_mfa; 248 u8 loss_mfa;
253 ucchar prbs; 249 u8 prbs;
254} falc_t; 250} falc_t;
255 251
256typedef struct falc_status { 252typedef struct falc_status {
257 ucchar sync; /* If true FALC is synchronized */ 253 u8 sync; /* If true FALC is synchronized */
258 ucchar red_alarm; 254 u8 red_alarm;
259 ucchar blue_alarm; 255 u8 blue_alarm;
260 ucchar loss_fa; 256 u8 loss_fa;
261 ucchar yellow_alarm; 257 u8 yellow_alarm;
262 ucchar loss_mfa; 258 u8 loss_mfa;
263 ucchar prbs; 259 u8 prbs;
264} falc_status_t; 260} falc_status_t;
265 261
266typedef struct rsv_x21_status { 262typedef struct rsv_x21_status {
267 ucchar dcd; 263 u8 dcd;
268 ucchar dsr; 264 u8 dsr;
269 ucchar cts; 265 u8 cts;
270 ucchar rts; 266 u8 rts;
271 ucchar dtr; 267 u8 dtr;
272} rsv_x21_status_t; 268} rsv_x21_status_t;
273 269
274typedef struct pc300stats { 270typedef struct pc300stats {
275 int hw_type; 271 int hw_type;
276 uclong line_on; 272 u32 line_on;
277 uclong line_off; 273 u32 line_off;
278 struct net_device_stats gen_stats; 274 struct net_device_stats gen_stats;
279 falc_t te_stats; 275 falc_t te_stats;
280} pc300stats_t; 276} pc300stats_t;
@@ -292,14 +288,14 @@ typedef struct pc300loopback {
292 288
293typedef struct pc300patterntst { 289typedef struct pc300patterntst {
294 char patrntst_on; /* 0 - off; 1 - on; 2 - read num_errors */ 290 char patrntst_on; /* 0 - off; 1 - on; 2 - read num_errors */
295 ucshort num_errors; 291 u16 num_errors;
296} pc300patterntst_t; 292} pc300patterntst_t;
297 293
298typedef struct pc300dev { 294typedef struct pc300dev {
299 struct pc300ch *chan; 295 struct pc300ch *chan;
300 ucchar trace_on; 296 u8 trace_on;
301 uclong line_on; /* DCD(X.21, RSV) / sync(TE) change counters */ 297 u32 line_on; /* DCD(X.21, RSV) / sync(TE) change counters */
302 uclong line_off; 298 u32 line_off;
303 char name[16]; 299 char name[16];
304 struct net_device *dev; 300 struct net_device *dev;
305#ifdef CONFIG_PC300_MLPPP 301#ifdef CONFIG_PC300_MLPPP
@@ -312,42 +308,42 @@ typedef struct pc300hw {
312 int bus; /* Bus (PCI, PMC, etc.) */ 308 int bus; /* Bus (PCI, PMC, etc.) */
313 int nchan; /* number of channels */ 309 int nchan; /* number of channels */
314 int irq; /* interrupt request level */ 310 int irq; /* interrupt request level */
315 uclong clock; /* Board clock */ 311 u32 clock; /* Board clock */
316 ucchar cpld_id; /* CPLD ID (TE only) */ 312 u8 cpld_id; /* CPLD ID (TE only) */
317 ucshort cpld_reg1; /* CPLD reg 1 (TE only) */ 313 u16 cpld_reg1; /* CPLD reg 1 (TE only) */
318 ucshort cpld_reg2; /* CPLD reg 2 (TE only) */ 314 u16 cpld_reg2; /* CPLD reg 2 (TE only) */
319 ucshort gpioc_reg; /* PLX GPIOC reg */ 315 u16 gpioc_reg; /* PLX GPIOC reg */
320 ucshort intctl_reg; /* PLX Int Ctrl/Status reg */ 316 u16 intctl_reg; /* PLX Int Ctrl/Status reg */
321 uclong iophys; /* PLX registers I/O base */ 317 u32 iophys; /* PLX registers I/O base */
322 uclong iosize; /* PLX registers I/O size */ 318 u32 iosize; /* PLX registers I/O size */
323 uclong plxphys; /* PLX registers MMIO base (physical) */ 319 u32 plxphys; /* PLX registers MMIO base (physical) */
324 void __iomem * plxbase; /* PLX registers MMIO base (virtual) */ 320 void __iomem * plxbase; /* PLX registers MMIO base (virtual) */
325 uclong plxsize; /* PLX registers MMIO size */ 321 u32 plxsize; /* PLX registers MMIO size */
326 uclong scaphys; /* SCA registers MMIO base (physical) */ 322 u32 scaphys; /* SCA registers MMIO base (physical) */
327 void __iomem * scabase; /* SCA registers MMIO base (virtual) */ 323 void __iomem * scabase; /* SCA registers MMIO base (virtual) */
328 uclong scasize; /* SCA registers MMIO size */ 324 u32 scasize; /* SCA registers MMIO size */
329 uclong ramphys; /* On-board RAM MMIO base (physical) */ 325 u32 ramphys; /* On-board RAM MMIO base (physical) */
330 void __iomem * rambase; /* On-board RAM MMIO base (virtual) */ 326 void __iomem * rambase; /* On-board RAM MMIO base (virtual) */
331 uclong alloc_ramsize; /* RAM MMIO size allocated by the PCI bridge */ 327 u32 alloc_ramsize; /* RAM MMIO size allocated by the PCI bridge */
332 uclong ramsize; /* On-board RAM MMIO size */ 328 u32 ramsize; /* On-board RAM MMIO size */
333 uclong falcphys; /* FALC registers MMIO base (physical) */ 329 u32 falcphys; /* FALC registers MMIO base (physical) */
334 void __iomem * falcbase;/* FALC registers MMIO base (virtual) */ 330 void __iomem * falcbase;/* FALC registers MMIO base (virtual) */
335 uclong falcsize; /* FALC registers MMIO size */ 331 u32 falcsize; /* FALC registers MMIO size */
336} pc300hw_t; 332} pc300hw_t;
337 333
338typedef struct pc300chconf { 334typedef struct pc300chconf {
339 sync_serial_settings phys_settings; /* Clock type/rate (in bps), 335 sync_serial_settings phys_settings; /* Clock type/rate (in bps),
340 loopback mode */ 336 loopback mode */
341 raw_hdlc_proto proto_settings; /* Encoding, parity (CRC) */ 337 raw_hdlc_proto proto_settings; /* Encoding, parity (CRC) */
342 uclong media; /* HW media (RS232, V.35, etc.) */ 338 u32 media; /* HW media (RS232, V.35, etc.) */
343 uclong proto; /* Protocol (PPP, X.25, etc.) */ 339 u32 proto; /* Protocol (PPP, X.25, etc.) */
344 340
345 /* TE-specific parameters */ 341 /* TE-specific parameters */
346 ucchar lcode; /* Line Code (AMI, B8ZS, etc.) */ 342 u8 lcode; /* Line Code (AMI, B8ZS, etc.) */
347 ucchar fr_mode; /* Frame Mode (ESF, D4, etc.) */ 343 u8 fr_mode; /* Frame Mode (ESF, D4, etc.) */
348 ucchar lbo; /* Line Build Out */ 344 u8 lbo; /* Line Build Out */
349 ucchar rx_sens; /* Rx Sensitivity (long- or short-haul) */ 345 u8 rx_sens; /* Rx Sensitivity (long- or short-haul) */
350 uclong tslot_bitmap; /* bit[i]=1 => timeslot _i_ is active */ 346 u32 tslot_bitmap; /* bit[i]=1 => timeslot _i_ is active */
351} pc300chconf_t; 347} pc300chconf_t;
352 348
353typedef struct pc300ch { 349typedef struct pc300ch {
@@ -355,12 +351,12 @@ typedef struct pc300ch {
355 int channel; 351 int channel;
356 pc300dev_t d; 352 pc300dev_t d;
357 pc300chconf_t conf; 353 pc300chconf_t conf;
358 ucchar tx_first_bd; /* First TX DMA block descr. w/ data */ 354 u8 tx_first_bd; /* First TX DMA block descr. w/ data */
359 ucchar tx_next_bd; /* Next free TX DMA block descriptor */ 355 u8 tx_next_bd; /* Next free TX DMA block descriptor */
360 ucchar rx_first_bd; /* First free RX DMA block descriptor */ 356 u8 rx_first_bd; /* First free RX DMA block descriptor */
361 ucchar rx_last_bd; /* Last free RX DMA block descriptor */ 357 u8 rx_last_bd; /* Last free RX DMA block descriptor */
362 ucchar nfree_tx_bd; /* Number of free TX DMA block descriptors */ 358 u8 nfree_tx_bd; /* Number of free TX DMA block descriptors */
363 falc_t falc; /* FALC structure (TE only) */ 359 falc_t falc; /* FALC structure (TE only) */
364} pc300ch_t; 360} pc300ch_t;
365 361
366typedef struct pc300 { 362typedef struct pc300 {