diff options
Diffstat (limited to 'drivers/net/defxx.c')
-rw-r--r-- | drivers/net/defxx.c | 268 |
1 files changed, 134 insertions, 134 deletions
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c index 7d06dedbfb26..ae9680552b82 100644 --- a/drivers/net/defxx.c +++ b/drivers/net/defxx.c | |||
@@ -275,7 +275,7 @@ static void dfx_xmt_flush(DFX_board_t *bp); | |||
275 | 275 | ||
276 | static struct net_device *root_dfx_eisa_dev; | 276 | static struct net_device *root_dfx_eisa_dev; |
277 | 277 | ||
278 | 278 | ||
279 | /* | 279 | /* |
280 | * ======================= | 280 | * ======================= |
281 | * = dfx_port_write_byte = | 281 | * = dfx_port_write_byte = |
@@ -283,13 +283,13 @@ static struct net_device *root_dfx_eisa_dev; | |||
283 | * = dfx_port_write_long = | 283 | * = dfx_port_write_long = |
284 | * = dfx_port_read_long = | 284 | * = dfx_port_read_long = |
285 | * ======================= | 285 | * ======================= |
286 | * | 286 | * |
287 | * Overview: | 287 | * Overview: |
288 | * Routines for reading and writing values from/to adapter | 288 | * Routines for reading and writing values from/to adapter |
289 | * | 289 | * |
290 | * Returns: | 290 | * Returns: |
291 | * None | 291 | * None |
292 | * | 292 | * |
293 | * Arguments: | 293 | * Arguments: |
294 | * bp - pointer to board information | 294 | * bp - pointer to board information |
295 | * offset - register offset from base I/O address | 295 | * offset - register offset from base I/O address |
@@ -301,7 +301,7 @@ static struct net_device *root_dfx_eisa_dev; | |||
301 | * Functional Description: | 301 | * Functional Description: |
302 | * These routines perform the correct operation to read or write | 302 | * These routines perform the correct operation to read or write |
303 | * the adapter register. | 303 | * the adapter register. |
304 | * | 304 | * |
305 | * EISA port block base addresses are based on the slot number in which the | 305 | * EISA port block base addresses are based on the slot number in which the |
306 | * controller is installed. For example, if the EISA controller is installed | 306 | * controller is installed. For example, if the EISA controller is installed |
307 | * in slot 4, the port block base address is 0x4000. If the controller is | 307 | * in slot 4, the port block base address is 0x4000. If the controller is |
@@ -377,18 +377,18 @@ static inline void dfx_port_read_long( | |||
377 | *data = inl(port); | 377 | *data = inl(port); |
378 | } | 378 | } |
379 | 379 | ||
380 | 380 | ||
381 | /* | 381 | /* |
382 | * ============= | 382 | * ============= |
383 | * = dfx_init_one_pci_or_eisa = | 383 | * = dfx_init_one_pci_or_eisa = |
384 | * ============= | 384 | * ============= |
385 | * | 385 | * |
386 | * Overview: | 386 | * Overview: |
387 | * Initializes a supported FDDI EISA or PCI controller | 387 | * Initializes a supported FDDI EISA or PCI controller |
388 | * | 388 | * |
389 | * Returns: | 389 | * Returns: |
390 | * Condition code | 390 | * Condition code |
391 | * | 391 | * |
392 | * Arguments: | 392 | * Arguments: |
393 | * pdev - pointer to pci device information (NULL for EISA) | 393 | * pdev - pointer to pci device information (NULL for EISA) |
394 | * ioaddr - pointer to port (NULL for PCI) | 394 | * ioaddr - pointer to port (NULL for PCI) |
@@ -537,18 +537,18 @@ static int __init dfx_eisa_init(void) | |||
537 | } | 537 | } |
538 | return rc; | 538 | return rc; |
539 | } | 539 | } |
540 | 540 | ||
541 | /* | 541 | /* |
542 | * ================ | 542 | * ================ |
543 | * = dfx_bus_init = | 543 | * = dfx_bus_init = |
544 | * ================ | 544 | * ================ |
545 | * | 545 | * |
546 | * Overview: | 546 | * Overview: |
547 | * Initializes EISA and PCI controller bus-specific logic. | 547 | * Initializes EISA and PCI controller bus-specific logic. |
548 | * | 548 | * |
549 | * Returns: | 549 | * Returns: |
550 | * None | 550 | * None |
551 | * | 551 | * |
552 | * Arguments: | 552 | * Arguments: |
553 | * dev - pointer to device information | 553 | * dev - pointer to device information |
554 | * | 554 | * |
@@ -672,19 +672,19 @@ static void __devinit dfx_bus_init(struct net_device *dev) | |||
672 | } | 672 | } |
673 | } | 673 | } |
674 | 674 | ||
675 | 675 | ||
676 | /* | 676 | /* |
677 | * ======================== | 677 | * ======================== |
678 | * = dfx_bus_config_check = | 678 | * = dfx_bus_config_check = |
679 | * ======================== | 679 | * ======================== |
680 | * | 680 | * |
681 | * Overview: | 681 | * Overview: |
682 | * Checks the configuration (burst size, full-duplex, etc.) If any parameters | 682 | * Checks the configuration (burst size, full-duplex, etc.) If any parameters |
683 | * are illegal, then this routine will set new defaults. | 683 | * are illegal, then this routine will set new defaults. |
684 | * | 684 | * |
685 | * Returns: | 685 | * Returns: |
686 | * None | 686 | * None |
687 | * | 687 | * |
688 | * Arguments: | 688 | * Arguments: |
689 | * bp - pointer to board information | 689 | * bp - pointer to board information |
690 | * | 690 | * |
@@ -766,19 +766,19 @@ static void __devinit dfx_bus_config_check(DFX_board_t *bp) | |||
766 | } | 766 | } |
767 | } | 767 | } |
768 | 768 | ||
769 | 769 | ||
770 | /* | 770 | /* |
771 | * =================== | 771 | * =================== |
772 | * = dfx_driver_init = | 772 | * = dfx_driver_init = |
773 | * =================== | 773 | * =================== |
774 | * | 774 | * |
775 | * Overview: | 775 | * Overview: |
776 | * Initializes remaining adapter board structure information | 776 | * Initializes remaining adapter board structure information |
777 | * and makes sure adapter is in a safe state prior to dfx_open(). | 777 | * and makes sure adapter is in a safe state prior to dfx_open(). |
778 | * | 778 | * |
779 | * Returns: | 779 | * Returns: |
780 | * Condition code | 780 | * Condition code |
781 | * | 781 | * |
782 | * Arguments: | 782 | * Arguments: |
783 | * dev - pointer to device information | 783 | * dev - pointer to device information |
784 | * print_name - printable device name | 784 | * print_name - printable device name |
@@ -984,18 +984,18 @@ static int __devinit dfx_driver_init(struct net_device *dev, | |||
984 | return(DFX_K_SUCCESS); | 984 | return(DFX_K_SUCCESS); |
985 | } | 985 | } |
986 | 986 | ||
987 | 987 | ||
988 | /* | 988 | /* |
989 | * ================= | 989 | * ================= |
990 | * = dfx_adap_init = | 990 | * = dfx_adap_init = |
991 | * ================= | 991 | * ================= |
992 | * | 992 | * |
993 | * Overview: | 993 | * Overview: |
994 | * Brings the adapter to the link avail/link unavailable state. | 994 | * Brings the adapter to the link avail/link unavailable state. |
995 | * | 995 | * |
996 | * Returns: | 996 | * Returns: |
997 | * Condition code | 997 | * Condition code |
998 | * | 998 | * |
999 | * Arguments: | 999 | * Arguments: |
1000 | * bp - pointer to board information | 1000 | * bp - pointer to board information |
1001 | * get_buffers - non-zero if buffers to be allocated | 1001 | * get_buffers - non-zero if buffers to be allocated |
@@ -1188,18 +1188,18 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers) | |||
1188 | return(DFX_K_SUCCESS); | 1188 | return(DFX_K_SUCCESS); |
1189 | } | 1189 | } |
1190 | 1190 | ||
1191 | 1191 | ||
1192 | /* | 1192 | /* |
1193 | * ============ | 1193 | * ============ |
1194 | * = dfx_open = | 1194 | * = dfx_open = |
1195 | * ============ | 1195 | * ============ |
1196 | * | 1196 | * |
1197 | * Overview: | 1197 | * Overview: |
1198 | * Opens the adapter | 1198 | * Opens the adapter |
1199 | * | 1199 | * |
1200 | * Returns: | 1200 | * Returns: |
1201 | * Condition code | 1201 | * Condition code |
1202 | * | 1202 | * |
1203 | * Arguments: | 1203 | * Arguments: |
1204 | * dev - pointer to device information | 1204 | * dev - pointer to device information |
1205 | * | 1205 | * |
@@ -1225,7 +1225,7 @@ static int dfx_open(struct net_device *dev) | |||
1225 | DFX_board_t *bp = dev->priv; | 1225 | DFX_board_t *bp = dev->priv; |
1226 | 1226 | ||
1227 | DBG_printk("In dfx_open...\n"); | 1227 | DBG_printk("In dfx_open...\n"); |
1228 | 1228 | ||
1229 | /* Register IRQ - support shared interrupts by passing device ptr */ | 1229 | /* Register IRQ - support shared interrupts by passing device ptr */ |
1230 | 1230 | ||
1231 | ret = request_irq(dev->irq, dfx_interrupt, IRQF_SHARED, dev->name, dev); | 1231 | ret = request_irq(dev->irq, dfx_interrupt, IRQF_SHARED, dev->name, dev); |
@@ -1276,18 +1276,18 @@ static int dfx_open(struct net_device *dev) | |||
1276 | return(0); | 1276 | return(0); |
1277 | } | 1277 | } |
1278 | 1278 | ||
1279 | 1279 | ||
1280 | /* | 1280 | /* |
1281 | * ============= | 1281 | * ============= |
1282 | * = dfx_close = | 1282 | * = dfx_close = |
1283 | * ============= | 1283 | * ============= |
1284 | * | 1284 | * |
1285 | * Overview: | 1285 | * Overview: |
1286 | * Closes the device/module. | 1286 | * Closes the device/module. |
1287 | * | 1287 | * |
1288 | * Returns: | 1288 | * Returns: |
1289 | * Condition code | 1289 | * Condition code |
1290 | * | 1290 | * |
1291 | * Arguments: | 1291 | * Arguments: |
1292 | * dev - pointer to device information | 1292 | * dev - pointer to device information |
1293 | * | 1293 | * |
@@ -1360,26 +1360,26 @@ static int dfx_close(struct net_device *dev) | |||
1360 | /* Clear device structure flags */ | 1360 | /* Clear device structure flags */ |
1361 | 1361 | ||
1362 | netif_stop_queue(dev); | 1362 | netif_stop_queue(dev); |
1363 | 1363 | ||
1364 | /* Deregister (free) IRQ */ | 1364 | /* Deregister (free) IRQ */ |
1365 | 1365 | ||
1366 | free_irq(dev->irq, dev); | 1366 | free_irq(dev->irq, dev); |
1367 | 1367 | ||
1368 | return(0); | 1368 | return(0); |
1369 | } | 1369 | } |
1370 | 1370 | ||
1371 | 1371 | ||
1372 | /* | 1372 | /* |
1373 | * ====================== | 1373 | * ====================== |
1374 | * = dfx_int_pr_halt_id = | 1374 | * = dfx_int_pr_halt_id = |
1375 | * ====================== | 1375 | * ====================== |
1376 | * | 1376 | * |
1377 | * Overview: | 1377 | * Overview: |
1378 | * Displays halt id's in string form. | 1378 | * Displays halt id's in string form. |
1379 | * | 1379 | * |
1380 | * Returns: | 1380 | * Returns: |
1381 | * None | 1381 | * None |
1382 | * | 1382 | * |
1383 | * Arguments: | 1383 | * Arguments: |
1384 | * bp - pointer to board information | 1384 | * bp - pointer to board information |
1385 | * | 1385 | * |
@@ -1452,18 +1452,18 @@ static void dfx_int_pr_halt_id(DFX_board_t *bp) | |||
1452 | } | 1452 | } |
1453 | } | 1453 | } |
1454 | 1454 | ||
1455 | 1455 | ||
1456 | /* | 1456 | /* |
1457 | * ========================== | 1457 | * ========================== |
1458 | * = dfx_int_type_0_process = | 1458 | * = dfx_int_type_0_process = |
1459 | * ========================== | 1459 | * ========================== |
1460 | * | 1460 | * |
1461 | * Overview: | 1461 | * Overview: |
1462 | * Processes Type 0 interrupts. | 1462 | * Processes Type 0 interrupts. |
1463 | * | 1463 | * |
1464 | * Returns: | 1464 | * Returns: |
1465 | * None | 1465 | * None |
1466 | * | 1466 | * |
1467 | * Arguments: | 1467 | * Arguments: |
1468 | * bp - pointer to board information | 1468 | * bp - pointer to board information |
1469 | * | 1469 | * |
@@ -1569,7 +1569,7 @@ static void dfx_int_type_0_process(DFX_board_t *bp) | |||
1569 | /* Check for adapter state change */ | 1569 | /* Check for adapter state change */ |
1570 | 1570 | ||
1571 | if (type_0_status & PI_TYPE_0_STAT_M_STATE_CHANGE) | 1571 | if (type_0_status & PI_TYPE_0_STAT_M_STATE_CHANGE) |
1572 | { | 1572 | { |
1573 | /* Get latest adapter state */ | 1573 | /* Get latest adapter state */ |
1574 | 1574 | ||
1575 | state = dfx_hw_adap_state_rd(bp); /* get adapter state */ | 1575 | state = dfx_hw_adap_state_rd(bp); /* get adapter state */ |
@@ -1604,18 +1604,18 @@ static void dfx_int_type_0_process(DFX_board_t *bp) | |||
1604 | } | 1604 | } |
1605 | } | 1605 | } |
1606 | 1606 | ||
1607 | 1607 | ||
1608 | /* | 1608 | /* |
1609 | * ================== | 1609 | * ================== |
1610 | * = dfx_int_common = | 1610 | * = dfx_int_common = |
1611 | * ================== | 1611 | * ================== |
1612 | * | 1612 | * |
1613 | * Overview: | 1613 | * Overview: |
1614 | * Interrupt service routine (ISR) | 1614 | * Interrupt service routine (ISR) |
1615 | * | 1615 | * |
1616 | * Returns: | 1616 | * Returns: |
1617 | * None | 1617 | * None |
1618 | * | 1618 | * |
1619 | * Arguments: | 1619 | * Arguments: |
1620 | * bp - pointer to board information | 1620 | * bp - pointer to board information |
1621 | * | 1621 | * |
@@ -1678,7 +1678,7 @@ static void dfx_int_common(struct net_device *dev) | |||
1678 | dfx_int_type_0_process(bp); /* process Type 0 interrupts */ | 1678 | dfx_int_type_0_process(bp); /* process Type 0 interrupts */ |
1679 | } | 1679 | } |
1680 | 1680 | ||
1681 | 1681 | ||
1682 | /* | 1682 | /* |
1683 | * ================= | 1683 | * ================= |
1684 | * = dfx_interrupt = | 1684 | * = dfx_interrupt = |
@@ -1780,18 +1780,18 @@ static irqreturn_t dfx_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
1780 | return IRQ_HANDLED; | 1780 | return IRQ_HANDLED; |
1781 | } | 1781 | } |
1782 | 1782 | ||
1783 | 1783 | ||
1784 | /* | 1784 | /* |
1785 | * ===================== | 1785 | * ===================== |
1786 | * = dfx_ctl_get_stats = | 1786 | * = dfx_ctl_get_stats = |
1787 | * ===================== | 1787 | * ===================== |
1788 | * | 1788 | * |
1789 | * Overview: | 1789 | * Overview: |
1790 | * Get statistics for FDDI adapter | 1790 | * Get statistics for FDDI adapter |
1791 | * | 1791 | * |
1792 | * Returns: | 1792 | * Returns: |
1793 | * Pointer to FDDI statistics structure | 1793 | * Pointer to FDDI statistics structure |
1794 | * | 1794 | * |
1795 | * Arguments: | 1795 | * Arguments: |
1796 | * dev - pointer to device information | 1796 | * dev - pointer to device information |
1797 | * | 1797 | * |
@@ -1967,19 +1967,19 @@ static struct net_device_stats *dfx_ctl_get_stats(struct net_device *dev) | |||
1967 | return((struct net_device_stats *) &bp->stats); | 1967 | return((struct net_device_stats *) &bp->stats); |
1968 | } | 1968 | } |
1969 | 1969 | ||
1970 | 1970 | ||
1971 | /* | 1971 | /* |
1972 | * ============================== | 1972 | * ============================== |
1973 | * = dfx_ctl_set_multicast_list = | 1973 | * = dfx_ctl_set_multicast_list = |
1974 | * ============================== | 1974 | * ============================== |
1975 | * | 1975 | * |
1976 | * Overview: | 1976 | * Overview: |
1977 | * Enable/Disable LLC frame promiscuous mode reception | 1977 | * Enable/Disable LLC frame promiscuous mode reception |
1978 | * on the adapter and/or update multicast address table. | 1978 | * on the adapter and/or update multicast address table. |
1979 | * | 1979 | * |
1980 | * Returns: | 1980 | * Returns: |
1981 | * None | 1981 | * None |
1982 | * | 1982 | * |
1983 | * Arguments: | 1983 | * Arguments: |
1984 | * dev - pointer to device information | 1984 | * dev - pointer to device information |
1985 | * | 1985 | * |
@@ -2088,19 +2088,19 @@ static void dfx_ctl_set_multicast_list(struct net_device *dev) | |||
2088 | } | 2088 | } |
2089 | } | 2089 | } |
2090 | 2090 | ||
2091 | 2091 | ||
2092 | /* | 2092 | /* |
2093 | * =========================== | 2093 | * =========================== |
2094 | * = dfx_ctl_set_mac_address = | 2094 | * = dfx_ctl_set_mac_address = |
2095 | * =========================== | 2095 | * =========================== |
2096 | * | 2096 | * |
2097 | * Overview: | 2097 | * Overview: |
2098 | * Add node address override (unicast address) to adapter | 2098 | * Add node address override (unicast address) to adapter |
2099 | * CAM and update dev_addr field in device table. | 2099 | * CAM and update dev_addr field in device table. |
2100 | * | 2100 | * |
2101 | * Returns: | 2101 | * Returns: |
2102 | * None | 2102 | * None |
2103 | * | 2103 | * |
2104 | * Arguments: | 2104 | * Arguments: |
2105 | * dev - pointer to device information | 2105 | * dev - pointer to device information |
2106 | * addr - pointer to sockaddr structure containing unicast address to add | 2106 | * addr - pointer to sockaddr structure containing unicast address to add |
@@ -2178,7 +2178,7 @@ static int dfx_ctl_set_mac_address(struct net_device *dev, void *addr) | |||
2178 | return(0); /* always return zero */ | 2178 | return(0); /* always return zero */ |
2179 | } | 2179 | } |
2180 | 2180 | ||
2181 | 2181 | ||
2182 | /* | 2182 | /* |
2183 | * ====================== | 2183 | * ====================== |
2184 | * = dfx_ctl_update_cam = | 2184 | * = dfx_ctl_update_cam = |
@@ -2263,7 +2263,7 @@ static int dfx_ctl_update_cam(DFX_board_t *bp) | |||
2263 | return(DFX_K_SUCCESS); | 2263 | return(DFX_K_SUCCESS); |
2264 | } | 2264 | } |
2265 | 2265 | ||
2266 | 2266 | ||
2267 | /* | 2267 | /* |
2268 | * ========================== | 2268 | * ========================== |
2269 | * = dfx_ctl_update_filters = | 2269 | * = dfx_ctl_update_filters = |
@@ -2272,10 +2272,10 @@ static int dfx_ctl_update_cam(DFX_board_t *bp) | |||
2272 | * Overview: | 2272 | * Overview: |
2273 | * Procedure to update adapter filters with desired | 2273 | * Procedure to update adapter filters with desired |
2274 | * filter settings. | 2274 | * filter settings. |
2275 | * | 2275 | * |
2276 | * Returns: | 2276 | * Returns: |
2277 | * Condition code | 2277 | * Condition code |
2278 | * | 2278 | * |
2279 | * Arguments: | 2279 | * Arguments: |
2280 | * bp - pointer to board information | 2280 | * bp - pointer to board information |
2281 | * | 2281 | * |
@@ -2329,18 +2329,18 @@ static int dfx_ctl_update_filters(DFX_board_t *bp) | |||
2329 | return(DFX_K_SUCCESS); | 2329 | return(DFX_K_SUCCESS); |
2330 | } | 2330 | } |
2331 | 2331 | ||
2332 | 2332 | ||
2333 | /* | 2333 | /* |
2334 | * ====================== | 2334 | * ====================== |
2335 | * = dfx_hw_dma_cmd_req = | 2335 | * = dfx_hw_dma_cmd_req = |
2336 | * ====================== | 2336 | * ====================== |
2337 | * | 2337 | * |
2338 | * Overview: | 2338 | * Overview: |
2339 | * Sends PDQ DMA command to adapter firmware | 2339 | * Sends PDQ DMA command to adapter firmware |
2340 | * | 2340 | * |
2341 | * Returns: | 2341 | * Returns: |
2342 | * Condition code | 2342 | * Condition code |
2343 | * | 2343 | * |
2344 | * Arguments: | 2344 | * Arguments: |
2345 | * bp - pointer to board information | 2345 | * bp - pointer to board information |
2346 | * | 2346 | * |
@@ -2374,9 +2374,9 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp) | |||
2374 | { | 2374 | { |
2375 | int status; /* adapter status */ | 2375 | int status; /* adapter status */ |
2376 | int timeout_cnt; /* used in for loops */ | 2376 | int timeout_cnt; /* used in for loops */ |
2377 | 2377 | ||
2378 | /* Make sure the adapter is in a state that we can issue the DMA command in */ | 2378 | /* Make sure the adapter is in a state that we can issue the DMA command in */ |
2379 | 2379 | ||
2380 | status = dfx_hw_adap_state_rd(bp); | 2380 | status = dfx_hw_adap_state_rd(bp); |
2381 | if ((status == PI_STATE_K_RESET) || | 2381 | if ((status == PI_STATE_K_RESET) || |
2382 | (status == PI_STATE_K_HALTED) || | 2382 | (status == PI_STATE_K_HALTED) || |
@@ -2397,7 +2397,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp) | |||
2397 | dfx_port_write_long(bp, PI_PDQ_K_REG_CMD_RSP_PROD, bp->cmd_rsp_reg.lword); | 2397 | dfx_port_write_long(bp, PI_PDQ_K_REG_CMD_RSP_PROD, bp->cmd_rsp_reg.lword); |
2398 | 2398 | ||
2399 | /* Put request buffer on the command request queue */ | 2399 | /* Put request buffer on the command request queue */ |
2400 | 2400 | ||
2401 | bp->descr_block_virt->cmd_req[bp->cmd_req_reg.index.prod].long_0 = (u32) (PI_XMT_DESCR_M_SOP | | 2401 | bp->descr_block_virt->cmd_req[bp->cmd_req_reg.index.prod].long_0 = (u32) (PI_XMT_DESCR_M_SOP | |
2402 | PI_XMT_DESCR_M_EOP | (PI_CMD_REQ_K_SIZE_MAX << PI_XMT_DESCR_V_SEG_LEN)); | 2402 | PI_XMT_DESCR_M_EOP | (PI_CMD_REQ_K_SIZE_MAX << PI_XMT_DESCR_V_SEG_LEN)); |
2403 | bp->descr_block_virt->cmd_req[bp->cmd_req_reg.index.prod].long_1 = bp->cmd_req_phys; | 2403 | bp->descr_block_virt->cmd_req[bp->cmd_req_reg.index.prod].long_1 = bp->cmd_req_phys; |
@@ -2419,7 +2419,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp) | |||
2419 | break; | 2419 | break; |
2420 | udelay(100); /* wait for 100 microseconds */ | 2420 | udelay(100); /* wait for 100 microseconds */ |
2421 | } | 2421 | } |
2422 | if (timeout_cnt == 0) | 2422 | if (timeout_cnt == 0) |
2423 | return(DFX_K_HW_TIMEOUT); | 2423 | return(DFX_K_HW_TIMEOUT); |
2424 | 2424 | ||
2425 | /* Bump (and wrap) the completion index and write out to register */ | 2425 | /* Bump (and wrap) the completion index and write out to register */ |
@@ -2439,7 +2439,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp) | |||
2439 | break; | 2439 | break; |
2440 | udelay(100); /* wait for 100 microseconds */ | 2440 | udelay(100); /* wait for 100 microseconds */ |
2441 | } | 2441 | } |
2442 | if (timeout_cnt == 0) | 2442 | if (timeout_cnt == 0) |
2443 | return(DFX_K_HW_TIMEOUT); | 2443 | return(DFX_K_HW_TIMEOUT); |
2444 | 2444 | ||
2445 | /* Bump (and wrap) the completion index and write out to register */ | 2445 | /* Bump (and wrap) the completion index and write out to register */ |
@@ -2450,18 +2450,18 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp) | |||
2450 | return(DFX_K_SUCCESS); | 2450 | return(DFX_K_SUCCESS); |
2451 | } | 2451 | } |
2452 | 2452 | ||
2453 | 2453 | ||
2454 | /* | 2454 | /* |
2455 | * ======================== | 2455 | * ======================== |
2456 | * = dfx_hw_port_ctrl_req = | 2456 | * = dfx_hw_port_ctrl_req = |
2457 | * ======================== | 2457 | * ======================== |
2458 | * | 2458 | * |
2459 | * Overview: | 2459 | * Overview: |
2460 | * Sends PDQ port control command to adapter firmware | 2460 | * Sends PDQ port control command to adapter firmware |
2461 | * | 2461 | * |
2462 | * Returns: | 2462 | * Returns: |
2463 | * Host data register value in host_data if ptr is not NULL | 2463 | * Host data register value in host_data if ptr is not NULL |
2464 | * | 2464 | * |
2465 | * Arguments: | 2465 | * Arguments: |
2466 | * bp - pointer to board information | 2466 | * bp - pointer to board information |
2467 | * command - port control command | 2467 | * command - port control command |
@@ -2497,7 +2497,7 @@ static int dfx_hw_port_ctrl_req( | |||
2497 | int timeout_cnt; /* used in for loops */ | 2497 | int timeout_cnt; /* used in for loops */ |
2498 | 2498 | ||
2499 | /* Set Command Error bit in command longword */ | 2499 | /* Set Command Error bit in command longword */ |
2500 | 2500 | ||
2501 | port_cmd = (PI_UINT32) (command | PI_PCTRL_M_CMD_ERROR); | 2501 | port_cmd = (PI_UINT32) (command | PI_PCTRL_M_CMD_ERROR); |
2502 | 2502 | ||
2503 | /* Issue port command to the adapter */ | 2503 | /* Issue port command to the adapter */ |
@@ -2520,12 +2520,12 @@ static int dfx_hw_port_ctrl_req( | |||
2520 | break; | 2520 | break; |
2521 | udelay(100); /* wait for 100 microseconds */ | 2521 | udelay(100); /* wait for 100 microseconds */ |
2522 | } | 2522 | } |
2523 | if (timeout_cnt == 0) | 2523 | if (timeout_cnt == 0) |
2524 | return(DFX_K_HW_TIMEOUT); | 2524 | return(DFX_K_HW_TIMEOUT); |
2525 | 2525 | ||
2526 | /* | 2526 | /* |
2527 | * If the address of host_data is non-zero, assume caller has supplied a | 2527 | * If the address of host_data is non-zero, assume caller has supplied a |
2528 | * non NULL pointer, and return the contents of the HOST_DATA register in | 2528 | * non NULL pointer, and return the contents of the HOST_DATA register in |
2529 | * it. | 2529 | * it. |
2530 | */ | 2530 | */ |
2531 | 2531 | ||
@@ -2534,18 +2534,18 @@ static int dfx_hw_port_ctrl_req( | |||
2534 | return(DFX_K_SUCCESS); | 2534 | return(DFX_K_SUCCESS); |
2535 | } | 2535 | } |
2536 | 2536 | ||
2537 | 2537 | ||
2538 | /* | 2538 | /* |
2539 | * ===================== | 2539 | * ===================== |
2540 | * = dfx_hw_adap_reset = | 2540 | * = dfx_hw_adap_reset = |
2541 | * ===================== | 2541 | * ===================== |
2542 | * | 2542 | * |
2543 | * Overview: | 2543 | * Overview: |
2544 | * Resets adapter | 2544 | * Resets adapter |
2545 | * | 2545 | * |
2546 | * Returns: | 2546 | * Returns: |
2547 | * None | 2547 | * None |
2548 | * | 2548 | * |
2549 | * Arguments: | 2549 | * Arguments: |
2550 | * bp - pointer to board information | 2550 | * bp - pointer to board information |
2551 | * type - type of reset to perform | 2551 | * type - type of reset to perform |
@@ -2588,18 +2588,18 @@ static void dfx_hw_adap_reset( | |||
2588 | dfx_port_write_long(bp, PI_PDQ_K_REG_PORT_RESET, 0); | 2588 | dfx_port_write_long(bp, PI_PDQ_K_REG_PORT_RESET, 0); |
2589 | } | 2589 | } |
2590 | 2590 | ||
2591 | 2591 | ||
2592 | /* | 2592 | /* |
2593 | * ======================== | 2593 | * ======================== |
2594 | * = dfx_hw_adap_state_rd = | 2594 | * = dfx_hw_adap_state_rd = |
2595 | * ======================== | 2595 | * ======================== |
2596 | * | 2596 | * |
2597 | * Overview: | 2597 | * Overview: |
2598 | * Returns current adapter state | 2598 | * Returns current adapter state |
2599 | * | 2599 | * |
2600 | * Returns: | 2600 | * Returns: |
2601 | * Adapter state per PDQ Port Specification | 2601 | * Adapter state per PDQ Port Specification |
2602 | * | 2602 | * |
2603 | * Arguments: | 2603 | * Arguments: |
2604 | * bp - pointer to board information | 2604 | * bp - pointer to board information |
2605 | * | 2605 | * |
@@ -2624,18 +2624,18 @@ static int dfx_hw_adap_state_rd(DFX_board_t *bp) | |||
2624 | return((port_status & PI_PSTATUS_M_STATE) >> PI_PSTATUS_V_STATE); | 2624 | return((port_status & PI_PSTATUS_M_STATE) >> PI_PSTATUS_V_STATE); |
2625 | } | 2625 | } |
2626 | 2626 | ||
2627 | 2627 | ||
2628 | /* | 2628 | /* |
2629 | * ===================== | 2629 | * ===================== |
2630 | * = dfx_hw_dma_uninit = | 2630 | * = dfx_hw_dma_uninit = |
2631 | * ===================== | 2631 | * ===================== |
2632 | * | 2632 | * |
2633 | * Overview: | 2633 | * Overview: |
2634 | * Brings adapter to DMA_UNAVAILABLE state | 2634 | * Brings adapter to DMA_UNAVAILABLE state |
2635 | * | 2635 | * |
2636 | * Returns: | 2636 | * Returns: |
2637 | * Condition code | 2637 | * Condition code |
2638 | * | 2638 | * |
2639 | * Arguments: | 2639 | * Arguments: |
2640 | * bp - pointer to board information | 2640 | * bp - pointer to board information |
2641 | * type - type of reset to perform | 2641 | * type - type of reset to perform |
@@ -2672,38 +2672,38 @@ static int dfx_hw_dma_uninit(DFX_board_t *bp, PI_UINT32 type) | |||
2672 | break; | 2672 | break; |
2673 | udelay(100); /* wait for 100 microseconds */ | 2673 | udelay(100); /* wait for 100 microseconds */ |
2674 | } | 2674 | } |
2675 | if (timeout_cnt == 0) | 2675 | if (timeout_cnt == 0) |
2676 | return(DFX_K_HW_TIMEOUT); | 2676 | return(DFX_K_HW_TIMEOUT); |
2677 | return(DFX_K_SUCCESS); | 2677 | return(DFX_K_SUCCESS); |
2678 | } | 2678 | } |
2679 | 2679 | ||
2680 | /* | 2680 | /* |
2681 | * Align an sk_buff to a boundary power of 2 | 2681 | * Align an sk_buff to a boundary power of 2 |
2682 | * | 2682 | * |
2683 | */ | 2683 | */ |
2684 | 2684 | ||
2685 | static void my_skb_align(struct sk_buff *skb, int n) | 2685 | static void my_skb_align(struct sk_buff *skb, int n) |
2686 | { | 2686 | { |
2687 | unsigned long x = (unsigned long)skb->data; | 2687 | unsigned long x = (unsigned long)skb->data; |
2688 | unsigned long v; | 2688 | unsigned long v; |
2689 | 2689 | ||
2690 | v = ALIGN(x, n); /* Where we want to be */ | 2690 | v = ALIGN(x, n); /* Where we want to be */ |
2691 | 2691 | ||
2692 | skb_reserve(skb, v - x); | 2692 | skb_reserve(skb, v - x); |
2693 | } | 2693 | } |
2694 | 2694 | ||
2695 | 2695 | ||
2696 | /* | 2696 | /* |
2697 | * ================ | 2697 | * ================ |
2698 | * = dfx_rcv_init = | 2698 | * = dfx_rcv_init = |
2699 | * ================ | 2699 | * ================ |
2700 | * | 2700 | * |
2701 | * Overview: | 2701 | * Overview: |
2702 | * Produces buffers to adapter LLC Host receive descriptor block | 2702 | * Produces buffers to adapter LLC Host receive descriptor block |
2703 | * | 2703 | * |
2704 | * Returns: | 2704 | * Returns: |
2705 | * None | 2705 | * None |
2706 | * | 2706 | * |
2707 | * Arguments: | 2707 | * Arguments: |
2708 | * bp - pointer to board information | 2708 | * bp - pointer to board information |
2709 | * get_buffers - non-zero if buffers to be allocated | 2709 | * get_buffers - non-zero if buffers to be allocated |
@@ -2764,7 +2764,7 @@ static int dfx_rcv_init(DFX_board_t *bp, int get_buffers) | |||
2764 | * align to 128 bytes for compatibility with | 2764 | * align to 128 bytes for compatibility with |
2765 | * the old EISA boards. | 2765 | * the old EISA boards. |
2766 | */ | 2766 | */ |
2767 | 2767 | ||
2768 | my_skb_align(newskb, 128); | 2768 | my_skb_align(newskb, 128); |
2769 | bp->descr_block_virt->rcv_data[i + j].long_1 = | 2769 | bp->descr_block_virt->rcv_data[i + j].long_1 = |
2770 | (u32)pci_map_single(bp->pci_dev, newskb->data, | 2770 | (u32)pci_map_single(bp->pci_dev, newskb->data, |
@@ -2795,18 +2795,18 @@ static int dfx_rcv_init(DFX_board_t *bp, int get_buffers) | |||
2795 | return 0; | 2795 | return 0; |
2796 | } | 2796 | } |
2797 | 2797 | ||
2798 | 2798 | ||
2799 | /* | 2799 | /* |
2800 | * ========================= | 2800 | * ========================= |
2801 | * = dfx_rcv_queue_process = | 2801 | * = dfx_rcv_queue_process = |
2802 | * ========================= | 2802 | * ========================= |
2803 | * | 2803 | * |
2804 | * Overview: | 2804 | * Overview: |
2805 | * Process received LLC frames. | 2805 | * Process received LLC frames. |
2806 | * | 2806 | * |
2807 | * Returns: | 2807 | * Returns: |
2808 | * None | 2808 | * None |
2809 | * | 2809 | * |
2810 | * Arguments: | 2810 | * Arguments: |
2811 | * bp - pointer to board information | 2811 | * bp - pointer to board information |
2812 | * | 2812 | * |
@@ -2880,7 +2880,7 @@ static void dfx_rcv_queue_process( | |||
2880 | newskb = dev_alloc_skb(NEW_SKB_SIZE); | 2880 | newskb = dev_alloc_skb(NEW_SKB_SIZE); |
2881 | if (newskb){ | 2881 | if (newskb){ |
2882 | rx_in_place = 1; | 2882 | rx_in_place = 1; |
2883 | 2883 | ||
2884 | my_skb_align(newskb, 128); | 2884 | my_skb_align(newskb, 128); |
2885 | skb = (struct sk_buff *)bp->p_rcv_buff_va[entry]; | 2885 | skb = (struct sk_buff *)bp->p_rcv_buff_va[entry]; |
2886 | pci_unmap_single(bp->pci_dev, | 2886 | pci_unmap_single(bp->pci_dev, |
@@ -2914,7 +2914,7 @@ static void dfx_rcv_queue_process( | |||
2914 | 2914 | ||
2915 | memcpy(skb->data, p_buff + RCV_BUFF_K_PADDING, pkt_len+3); | 2915 | memcpy(skb->data, p_buff + RCV_BUFF_K_PADDING, pkt_len+3); |
2916 | } | 2916 | } |
2917 | 2917 | ||
2918 | skb_reserve(skb,3); /* adjust data field so that it points to FC byte */ | 2918 | skb_reserve(skb,3); /* adjust data field so that it points to FC byte */ |
2919 | skb_put(skb, pkt_len); /* pass up packet length, NOT including CRC */ | 2919 | skb_put(skb, pkt_len); /* pass up packet length, NOT including CRC */ |
2920 | skb->dev = bp->dev; /* pass up device pointer */ | 2920 | skb->dev = bp->dev; /* pass up device pointer */ |
@@ -2945,18 +2945,18 @@ static void dfx_rcv_queue_process( | |||
2945 | } | 2945 | } |
2946 | } | 2946 | } |
2947 | 2947 | ||
2948 | 2948 | ||
2949 | /* | 2949 | /* |
2950 | * ===================== | 2950 | * ===================== |
2951 | * = dfx_xmt_queue_pkt = | 2951 | * = dfx_xmt_queue_pkt = |
2952 | * ===================== | 2952 | * ===================== |
2953 | * | 2953 | * |
2954 | * Overview: | 2954 | * Overview: |
2955 | * Queues packets for transmission | 2955 | * Queues packets for transmission |
2956 | * | 2956 | * |
2957 | * Returns: | 2957 | * Returns: |
2958 | * Condition code | 2958 | * Condition code |
2959 | * | 2959 | * |
2960 | * Arguments: | 2960 | * Arguments: |
2961 | * skb - pointer to sk_buff to queue for transmission | 2961 | * skb - pointer to sk_buff to queue for transmission |
2962 | * dev - pointer to device information | 2962 | * dev - pointer to device information |
@@ -3020,7 +3020,7 @@ static int dfx_xmt_queue_pkt( | |||
3020 | unsigned long flags; | 3020 | unsigned long flags; |
3021 | 3021 | ||
3022 | netif_stop_queue(dev); | 3022 | netif_stop_queue(dev); |
3023 | 3023 | ||
3024 | /* | 3024 | /* |
3025 | * Verify that incoming transmit request is OK | 3025 | * Verify that incoming transmit request is OK |
3026 | * | 3026 | * |
@@ -3032,7 +3032,7 @@ static int dfx_xmt_queue_pkt( | |||
3032 | 3032 | ||
3033 | if (!IN_RANGE(skb->len, FDDI_K_LLC_ZLEN, FDDI_K_LLC_LEN)) | 3033 | if (!IN_RANGE(skb->len, FDDI_K_LLC_ZLEN, FDDI_K_LLC_LEN)) |
3034 | { | 3034 | { |
3035 | printk("%s: Invalid packet length - %u bytes\n", | 3035 | printk("%s: Invalid packet length - %u bytes\n", |
3036 | dev->name, skb->len); | 3036 | dev->name, skb->len); |
3037 | bp->xmt_length_errors++; /* bump error counter */ | 3037 | bp->xmt_length_errors++; /* bump error counter */ |
3038 | netif_wake_queue(dev); | 3038 | netif_wake_queue(dev); |
@@ -3065,7 +3065,7 @@ static int dfx_xmt_queue_pkt( | |||
3065 | } | 3065 | } |
3066 | 3066 | ||
3067 | spin_lock_irqsave(&bp->lock, flags); | 3067 | spin_lock_irqsave(&bp->lock, flags); |
3068 | 3068 | ||
3069 | /* Get the current producer and the next free xmt data descriptor */ | 3069 | /* Get the current producer and the next free xmt data descriptor */ |
3070 | 3070 | ||
3071 | prod = bp->rcv_xmt_reg.index.xmt_prod; | 3071 | prod = bp->rcv_xmt_reg.index.xmt_prod; |
@@ -3167,18 +3167,18 @@ static int dfx_xmt_queue_pkt( | |||
3167 | return(0); /* packet queued to adapter */ | 3167 | return(0); /* packet queued to adapter */ |
3168 | } | 3168 | } |
3169 | 3169 | ||
3170 | 3170 | ||
3171 | /* | 3171 | /* |
3172 | * ================ | 3172 | * ================ |
3173 | * = dfx_xmt_done = | 3173 | * = dfx_xmt_done = |
3174 | * ================ | 3174 | * ================ |
3175 | * | 3175 | * |
3176 | * Overview: | 3176 | * Overview: |
3177 | * Processes all frames that have been transmitted. | 3177 | * Processes all frames that have been transmitted. |
3178 | * | 3178 | * |
3179 | * Returns: | 3179 | * Returns: |
3180 | * None | 3180 | * None |
3181 | * | 3181 | * |
3182 | * Arguments: | 3182 | * Arguments: |
3183 | * bp - pointer to board information | 3183 | * bp - pointer to board information |
3184 | * | 3184 | * |
@@ -3246,18 +3246,18 @@ static int dfx_xmt_done(DFX_board_t *bp) | |||
3246 | return freed; | 3246 | return freed; |
3247 | } | 3247 | } |
3248 | 3248 | ||
3249 | 3249 | ||
3250 | /* | 3250 | /* |
3251 | * ================= | 3251 | * ================= |
3252 | * = dfx_rcv_flush = | 3252 | * = dfx_rcv_flush = |
3253 | * ================= | 3253 | * ================= |
3254 | * | 3254 | * |
3255 | * Overview: | 3255 | * Overview: |
3256 | * Remove all skb's in the receive ring. | 3256 | * Remove all skb's in the receive ring. |
3257 | * | 3257 | * |
3258 | * Returns: | 3258 | * Returns: |
3259 | * None | 3259 | * None |
3260 | * | 3260 | * |
3261 | * Arguments: | 3261 | * Arguments: |
3262 | * bp - pointer to board information | 3262 | * bp - pointer to board information |
3263 | * | 3263 | * |
@@ -3299,14 +3299,14 @@ static inline void dfx_rcv_flush( DFX_board_t *bp ) | |||
3299 | * ================= | 3299 | * ================= |
3300 | * = dfx_xmt_flush = | 3300 | * = dfx_xmt_flush = |
3301 | * ================= | 3301 | * ================= |
3302 | * | 3302 | * |
3303 | * Overview: | 3303 | * Overview: |
3304 | * Processes all frames whether they've been transmitted | 3304 | * Processes all frames whether they've been transmitted |
3305 | * or not. | 3305 | * or not. |
3306 | * | 3306 | * |
3307 | * Returns: | 3307 | * Returns: |
3308 | * None | 3308 | * None |
3309 | * | 3309 | * |
3310 | * Arguments: | 3310 | * Arguments: |
3311 | * bp - pointer to board information | 3311 | * bp - pointer to board information |
3312 | * | 3312 | * |
@@ -3446,11 +3446,11 @@ static int __init dfx_init(void) | |||
3446 | 3446 | ||
3447 | rc_pci = pci_register_driver(&dfx_driver); | 3447 | rc_pci = pci_register_driver(&dfx_driver); |
3448 | if (rc_pci >= 0) dfx_have_pci = 1; | 3448 | if (rc_pci >= 0) dfx_have_pci = 1; |
3449 | 3449 | ||
3450 | rc_eisa = dfx_eisa_init(); | 3450 | rc_eisa = dfx_eisa_init(); |
3451 | if (rc_eisa >= 0) dfx_have_eisa = 1; | 3451 | if (rc_eisa >= 0) dfx_have_eisa = 1; |
3452 | 3452 | ||
3453 | return ((rc_eisa < 0) ? 0 : rc_eisa) + ((rc_pci < 0) ? 0 : rc_pci); | 3453 | return ((rc_eisa < 0) ? 0 : rc_eisa) + ((rc_pci < 0) ? 0 : rc_pci); |
3454 | } | 3454 | } |
3455 | 3455 | ||
3456 | static void __exit dfx_cleanup(void) | 3456 | static void __exit dfx_cleanup(void) |
@@ -3459,8 +3459,8 @@ static void __exit dfx_cleanup(void) | |||
3459 | pci_unregister_driver(&dfx_driver); | 3459 | pci_unregister_driver(&dfx_driver); |
3460 | if (dfx_have_eisa) | 3460 | if (dfx_have_eisa) |
3461 | dfx_eisa_cleanup(); | 3461 | dfx_eisa_cleanup(); |
3462 | 3462 | ||
3463 | } | 3463 | } |
3464 | 3464 | ||
3465 | module_init(dfx_init); | 3465 | module_init(dfx_init); |
3466 | module_exit(dfx_cleanup); | 3466 | module_exit(dfx_cleanup); |
@@ -3469,7 +3469,7 @@ MODULE_DESCRIPTION("DEC FDDIcontroller EISA/PCI (DEFEA/DEFPA) driver " | |||
3469 | DRV_VERSION " " DRV_RELDATE); | 3469 | DRV_VERSION " " DRV_RELDATE); |
3470 | MODULE_LICENSE("GPL"); | 3470 | MODULE_LICENSE("GPL"); |
3471 | 3471 | ||
3472 | 3472 | ||
3473 | /* | 3473 | /* |
3474 | * Local variables: | 3474 | * Local variables: |
3475 | * kernel-compile-command: "gcc -D__KERNEL__ -I/root/linux/include -Wall -Wstrict-prototypes -O2 -pipe -fomit-frame-pointer -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -c defxx.c" | 3475 | * kernel-compile-command: "gcc -D__KERNEL__ -I/root/linux/include -Wall -Wstrict-prototypes -O2 -pipe -fomit-frame-pointer -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -c defxx.c" |