aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/lanai.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/atm/lanai.c')
-rw-r--r--drivers/atm/lanai.c102
1 files changed, 8 insertions, 94 deletions
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 51ec14787293..69f4c7ce9a63 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -39,7 +39,7 @@
39 * o lanai_change_qos() isn't written yet 39 * o lanai_change_qos() isn't written yet
40 * 40 *
41 * o There aren't any ioctl's yet -- I'd like to eventually support 41 * o There aren't any ioctl's yet -- I'd like to eventually support
42 * setting loopback and LED modes that way. (see lanai_ioctl) 42 * setting loopback and LED modes that way.
43 * 43 *
44 * o If the segmentation engine or DMA gets shut down we should restart 44 * o If the segmentation engine or DMA gets shut down we should restart
45 * card as per section 17.0i. (see lanai_reset) 45 * card as per section 17.0i. (see lanai_reset)
@@ -305,7 +305,7 @@ struct lanai_dev {
305 * vci with their bit set 305 * vci with their bit set
306 */ 306 */
307static void vci_bitfield_iterate(struct lanai_dev *lanai, 307static void vci_bitfield_iterate(struct lanai_dev *lanai,
308 /*const*/ unsigned long *lp, 308 const unsigned long *lp,
309 void (*func)(struct lanai_dev *,vci_t vci)) 309 void (*func)(struct lanai_dev *,vci_t vci))
310{ 310{
311 vci_t vci = find_first_bit(lp, NUM_VCI); 311 vci_t vci = find_first_bit(lp, NUM_VCI);
@@ -951,7 +951,7 @@ static int __devinit eeprom_read(struct lanai_dev *lanai)
951/* read a big-endian 4-byte value out of eeprom */ 951/* read a big-endian 4-byte value out of eeprom */
952static inline u32 eeprom_be4(const struct lanai_dev *lanai, int address) 952static inline u32 eeprom_be4(const struct lanai_dev *lanai, int address)
953{ 953{
954 return be32_to_cpup((u32 *) (&lanai->eeprom[address])); 954 return be32_to_cpup((const u32 *) &lanai->eeprom[address]);
955} 955}
956 956
957/* Checksum/validate EEPROM contents */ 957/* Checksum/validate EEPROM contents */
@@ -1160,7 +1160,7 @@ static inline int vcc_tx_space(const struct lanai_vcc *lvcc, int endptr)
1160} 1160}
1161 1161
1162/* test if VCC is currently backlogged */ 1162/* test if VCC is currently backlogged */
1163static inline int vcc_is_backlogged(/*const*/ struct lanai_vcc *lvcc) 1163static inline int vcc_is_backlogged(const struct lanai_vcc *lvcc)
1164{ 1164{
1165 return !skb_queue_empty(&lvcc->tx.backlog); 1165 return !skb_queue_empty(&lvcc->tx.backlog);
1166} 1166}
@@ -1395,7 +1395,8 @@ static void vcc_rx_aal5(struct lanai_vcc *lvcc, int endptr)
1395{ 1395{
1396 int size; 1396 int size;
1397 struct sk_buff *skb; 1397 struct sk_buff *skb;
1398 /*const*/ u32 *x, *end = &lvcc->rx.buf.start[endptr * 4]; 1398 const u32 *x;
1399 u32 *end = &lvcc->rx.buf.start[endptr * 4];
1399 int n = ((unsigned long) end) - ((unsigned long) lvcc->rx.buf.ptr); 1400 int n = ((unsigned long) end) - ((unsigned long) lvcc->rx.buf.ptr);
1400 if (n < 0) 1401 if (n < 0)
1401 n += lanai_buf_size(&lvcc->rx.buf); 1402 n += lanai_buf_size(&lvcc->rx.buf);
@@ -2111,7 +2112,7 @@ static int lanai_normalize_ci(struct lanai_dev *lanai,
2111 * shifted by that much as we compute 2112 * shifted by that much as we compute
2112 * 2113 *
2113 */ 2114 */
2114static int pcr_to_cbricg(/*const*/ struct atm_qos *qos) 2115static int pcr_to_cbricg(const struct atm_qos *qos)
2115{ 2116{
2116 int rounddown = 0; /* 1 = Round PCR down, i.e. round ICG _up_ */ 2117 int rounddown = 0; /* 1 = Round PCR down, i.e. round ICG _up_ */
2117 int x, icg, pcr = atm_pcr_goal(&qos->txtp); 2118 int x, icg, pcr = atm_pcr_goal(&qos->txtp);
@@ -2434,93 +2435,6 @@ static int lanai_open(struct atm_vcc *atmvcc)
2434 return result; 2435 return result;
2435} 2436}
2436 2437
2437#if 0
2438/* ioctl operations for card */
2439/* NOTE: these are all DEBUGGING ONLY currently */
2440static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void __user *arg)
2441{
2442 int result = 0;
2443 struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
2444 switch(cmd) {
2445 case 2106275:
2446 shutdown_atm_dev(atmdev);
2447 return 0;
2448 case 2200000: {
2449 unsigned long flags;
2450 spin_lock_irqsave(&lanai->servicelock, flags);
2451 run_service(lanai);
2452 spin_unlock_irqrestore(&lanai->servicelock, flags);
2453 return 0; }
2454 case 2200002:
2455 get_statistics(lanai);
2456 return 0;
2457 case 2200003: {
2458 unsigned int i;
2459 for (i = 0; i <= 0x5C ; i += 4) {
2460 if (i==0x48) /* Write-only butt reg */
2461 continue;
2462 printk(KERN_CRIT DEV_LABEL " 0x%02X: "
2463 "0x%08X\n", i,
2464 (unsigned int) readl(lanai->base + i));
2465 barrier(); mb();
2466 pcistatus_check(lanai, 0);
2467 barrier(); mb();
2468 }
2469 return 0; }
2470 case 2200004: {
2471 u8 b;
2472 u16 w;
2473 u32 dw;
2474 struct pci_dev *pci = lanai->pci;
2475 (void) pci_read_config_word(pci, PCI_VENDOR_ID, &w);
2476 DPRINTK("vendor = 0x%X\n", (unsigned int) w);
2477 (void) pci_read_config_word(pci, PCI_DEVICE_ID, &w);
2478 DPRINTK("device = 0x%X\n", (unsigned int) w);
2479 (void) pci_read_config_word(pci, PCI_COMMAND, &w);
2480 DPRINTK("command = 0x%X\n", (unsigned int) w);
2481 (void) pci_read_config_word(pci, PCI_STATUS, &w);
2482 DPRINTK("status = 0x%X\n", (unsigned int) w);
2483 (void) pci_read_config_dword(pci,
2484 PCI_CLASS_REVISION, &dw);
2485 DPRINTK("class/revision = 0x%X\n", (unsigned int) dw);
2486 (void) pci_read_config_byte(pci,
2487 PCI_CACHE_LINE_SIZE, &b);
2488 DPRINTK("cache line size = 0x%X\n", (unsigned int) b);
2489 (void) pci_read_config_byte(pci, PCI_LATENCY_TIMER, &b);
2490 DPRINTK("latency = %d (0x%X)\n",
2491 (int) b, (unsigned int) b);
2492 (void) pci_read_config_byte(pci, PCI_HEADER_TYPE, &b);
2493 DPRINTK("header type = 0x%X\n", (unsigned int) b);
2494 (void) pci_read_config_byte(pci, PCI_BIST, &b);
2495 DPRINTK("bist = 0x%X\n", (unsigned int) b);
2496 /* skipping a few here */
2497 (void) pci_read_config_byte(pci,
2498 PCI_INTERRUPT_LINE, &b);
2499 DPRINTK("pci_int_line = 0x%X\n", (unsigned int) b);
2500 (void) pci_read_config_byte(pci,
2501 PCI_INTERRUPT_PIN, &b);
2502 DPRINTK("pci_int_pin = 0x%X\n", (unsigned int) b);
2503 (void) pci_read_config_byte(pci, PCI_MIN_GNT, &b);
2504 DPRINTK("min_gnt = 0x%X\n", (unsigned int) b);
2505 (void) pci_read_config_byte(pci, PCI_MAX_LAT, &b);
2506 DPRINTK("max_lat = 0x%X\n", (unsigned int) b); }
2507 return 0;
2508#ifdef USE_POWERDOWN
2509 case 2200005:
2510 DPRINTK("Coming out of powerdown\n");
2511 lanai->conf1 &= ~CONFIG1_POWERDOWN;
2512 conf1_write(lanai);
2513 return 0;
2514#endif
2515 default:
2516 result = -ENOIOCTLCMD;
2517 }
2518 return result;
2519}
2520#else /* !0 */
2521#define lanai_ioctl NULL
2522#endif /* 0 */
2523
2524static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb) 2438static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb)
2525{ 2439{
2526 struct lanai_vcc *lvcc = (struct lanai_vcc *) atmvcc->dev_data; 2440 struct lanai_vcc *lvcc = (struct lanai_vcc *) atmvcc->dev_data;
@@ -2678,7 +2592,6 @@ static const struct atmdev_ops ops = {
2678 .dev_close = lanai_dev_close, 2592 .dev_close = lanai_dev_close,
2679 .open = lanai_open, 2593 .open = lanai_open,
2680 .close = lanai_close, 2594 .close = lanai_close,
2681 .ioctl = lanai_ioctl,
2682 .getsockopt = NULL, 2595 .getsockopt = NULL,
2683 .setsockopt = NULL, 2596 .setsockopt = NULL,
2684 .send = lanai_send, 2597 .send = lanai_send,
@@ -2760,6 +2673,7 @@ static void __exit lanai_module_exit(void)
2760 * gone, so there isn't much to do 2673 * gone, so there isn't much to do
2761 */ 2674 */
2762 DPRINTK("cleanup_module()\n"); 2675 DPRINTK("cleanup_module()\n");
2676 pci_unregister_driver(&lanai_driver);
2763} 2677}
2764 2678
2765module_init(lanai_module_init); 2679module_init(lanai_module_init);