26 #include <linux/slab.h>
34 #include <linux/if_vlan.h>
36 #include <linux/ipv6.h>
47 static char netxen_nic_driver_string[] =
"QLogic/NetXen Network Driver v"
53 static int wol_port_mode = 5;
55 static int use_msi = 1;
57 static int use_msi_x = 1;
61 MODULE_PARM_DESC(auto_fw_reset,
"Auto firmware reset (0=disabled, 1=enabled");
66 static int netxen_nic_open(
struct net_device *netdev);
67 static int netxen_nic_close(
struct net_device *netdev);
70 static void netxen_tx_timeout(
struct net_device *netdev);
77 #ifdef CONFIG_NET_POLL_CONTROLLER
78 static void netxen_nic_poll_controller(
struct net_device *netdev);
94 static void netxen_restore_indev_addr(
struct net_device *
dev,
unsigned long);
97 static int netxen_nic_set_mac(
struct net_device *netdev,
void *
p);
100 #define ENTRY(device) \
101 {PCI_DEVICE(PCI_VENDOR_ID_NETXEN, (device)), \
102 .class = PCI_CLASS_NETWORK_ETHERNET << 8, .class_mask = ~0}
118 static uint32_t crb_cmd_producer[4] = {
130 static uint32_t crb_cmd_consumer[4] = {
142 static uint32_t msi_tgt_status[8] = {
151 static inline void netxen_nic_disable_int(
struct nx_host_sds_ring *sds_ring)
194 if (netxen_alloc_sds_rings(recv_ctx, adapter->
max_sds_rings))
218 netxen_free_sds_rings(&adapter->
recv_ctx);
230 napi_enable(&sds_ring->
napi);
231 netxen_nic_enable_int(sds_ring);
244 netxen_nic_disable_int(sds_ring);
246 napi_disable(&sds_ring->
napi);
269 if (pci_set_dma_mask(pdev, mask) == 0 &&
270 pci_set_consistent_dma_mask(pdev, cmask) == 0) {
282 int change, shift,
err;
294 else if ((adapter->
ahw.revision_id ==
NX_P2_C1) && (shift <= 4))
299 old_cmask = pdev->
dev.coherent_dma_mask;
303 err = pci_set_dma_mask(pdev, mask);
309 err = pci_set_consistent_dma_mask(pdev, mask);
313 dev_info(&pdev->
dev,
"using %d-bit dma mask\n", 32+shift);
319 pci_set_dma_mask(pdev, old_mask);
320 pci_set_consistent_dma_mask(pdev, old_cmask);
325 netxen_check_hw_init(
struct netxen_adapter *adapter,
int first_boot)
329 if (first_boot == 0x55555555) {
338 if (!(first_boot & 0x4)) {
346 if (first_boot != 0x80000f) {
360 if (++timeout > 5000)
372 val = adapter->
ahw.board_type;
402 #define PCI_CAP_ID_GEN 0x10
404 static void netxen_pcie_strap_init(
struct netxen_adapter *adapter)
413 pdev = adapter->
pdev;
417 chicken &= 0xFCFFFFFF;
424 pci_read_config_dword(pdev, pos + 0x10, &control);
425 if ((control & 0x000F0000) != 0x00020000) {
427 chicken |= 0x01000000;
429 dev_info(&adapter->
pdev->dev,
"Gen2 strapping detected\n");
433 chicken |= 0x01000000;
434 dev_info(&adapter->
pdev->dev,
"Gen1 strapping detected\n");
446 pdevfuncsave = pdev->
devfn;
447 if (pdevfuncsave & 0x07)
450 for (i = 0; i < 8; i++) {
451 pci_read_config_dword(pdev, pos + 8, &control);
452 pci_read_config_dword(pdev, pos + 8, &control);
453 pci_write_config_dword(pdev, pos + 8, c8c9value);
456 pdev->
devfn = pdevfuncsave;
459 static void netxen_set_msix_bit(
struct pci_dev *pdev,
int enable)
466 pci_read_config_dword(pdev, pos, &control);
471 pci_write_config_dword(pdev, pos, control);
479 for (i = 0; i <
count; i++)
500 p = (
unsigned char *)&mac_addr;
501 for (i = 0; i < 6; i++)
509 if (!is_valid_ether_addr(netdev->
perm_addr))
515 static int netxen_nic_set_mac(
struct net_device *netdev,
void *p)
520 if (!is_valid_ether_addr(addr->
sa_data))
523 if (netif_running(netdev)) {
525 netxen_napi_disable(adapter);
532 if (netif_running(netdev)) {
534 netxen_napi_enable(adapter);
539 static void netxen_set_multicast_list(
struct net_device *
dev)
550 netdev_info(dev,
"disabling LRO as RXCSUM is off\n");
558 static int netxen_set_features(
struct net_device *dev,
580 .ndo_open = netxen_nic_open,
581 .ndo_stop = netxen_nic_close,
582 .ndo_start_xmit = netxen_nic_xmit_frame,
583 .ndo_get_stats64 = netxen_nic_get_stats,
585 .ndo_set_rx_mode = netxen_set_multicast_list,
586 .ndo_set_mac_address = netxen_nic_set_mac,
588 .ndo_tx_timeout = netxen_tx_timeout,
589 .ndo_fix_features = netxen_fix_features,
590 .ndo_set_features = netxen_set_features,
591 #ifdef CONFIG_NET_POLL_CONTROLLER
592 .ndo_poll_controller = netxen_nic_poll_controller,
614 legacy_intrp = &legacy_intr[adapter->
ahw.pci_func];
616 legacy_intrp = &legacy_intr[0];
634 netxen_set_msix_bit(pdev, 0);
638 netxen_init_msix_entries(adapter, num_msix);
642 netxen_set_msix_bit(pdev, 1);
657 if (use_msi && !pci_enable_msi(pdev)) {
660 msi_tgt_status[adapter->
ahw.pci_func]);
682 if (adapter->
ahw.db_base !=
NULL)
684 if (adapter->
ahw.pci_base0 !=
NULL)
686 if (adapter->
ahw.pci_base1 !=
NULL)
688 if (adapter->
ahw.pci_base2 !=
NULL)
698 unsigned long mem_len, db_len = 0;
710 adapter->
ahw.crb_win = -1;
711 adapter->
ahw.ocm_win = -1;
727 dev_err(&pdev->
dev,
"failed to map PCI bar 0\n");
740 dev_err(&pdev->
dev,
"failed to map PCI bar 0\n");
749 dev_err(&pdev->
dev,
"failed to map PCI bar 0\n");
759 dev_info(&pdev->
dev,
"%dMB memory map\n", (
int)(mem_len>>20));
792 adapter->
ahw.db_base = db_ptr;
797 netxen_cleanup_pci_map(adapter);
804 u32 fw_major, fw_minor, fw_build, prev_fw_version;
813 ptr32 = (
__le32 *)&serial_num;
815 for (i = 0; i < 8; i++) {
817 dev_err(&pdev->
dev,
"error reading board info\n");
822 offset +=
sizeof(
u32);
833 if (adapter->
mdump.md_template ==
NULL ||
840 "Failed to setup minidump rcode = %d\n", err);
845 get_brd_name_by_type(adapter->
ahw.board_type, brd_name);
847 pr_info(
"%s: %s Board S/N %s Chip rev 0x%x\n",
849 brd_name, serial_num, adapter->
ahw.revision_id);
854 dev_warn(&pdev->
dev,
"firmware version %d.%d.%d unsupported\n",
855 fw_major, fw_minor, fw_build);
861 adapter->
ahw.cut_through = (i & 0x8000) ? 1 : 0;
865 fw_major, fw_minor, fw_build,
866 adapter->
ahw.cut_through ?
"cut-through" :
"legacy");
890 switch (adapter->
ahw.board_type) {
920 err = nx_set_dma_mask(adapter);
924 err = netxen_can_start_firmware(adapter);
934 err = netxen_check_hw_init(adapter, first_boot);
936 dev_err(&pdev->
dev,
"error in init HW init sequence\n");
946 goto pcie_strap_init;
948 if (first_boot != 0x55555555) {
959 netxen_set_port_mode(adapter);
991 netxen_pcie_strap_init(adapter);
1003 nx_update_dma_mask(adapter);
1005 netxen_check_options(adapter);
1023 unsigned long flags = 0;
1028 handler = netxen_msix_intr;
1030 handler = netxen_msi_intr;
1033 handler = netxen_intr;
1035 adapter->
irq = netdev->
irq;
1041 flags, sds_ring->
name, sds_ring);
1064 netxen_nic_init_coalesce_defaults(
struct netxen_adapter *adapter)
1098 adapter->
ahw.linkup = 0;
1106 if (netdev->
features & NETIF_F_LRO)
1109 netxen_napi_enable(adapter);
1128 if (netif_running(netdev))
1129 err = __netxen_nic_up(adapter, netdev);
1148 netif_tx_disable(netdev);
1161 netxen_napi_disable(adapter);
1173 if (netif_running(netdev))
1174 __netxen_nic_down(adapter, netdev);
1203 err = netxen_napi_add(adapter, netdev);
1218 goto err_out_free_sw;
1232 netxen_nic_update_cmd_consumer(adapter, tx_ring);
1236 rds_ring = &adapter->
recv_ctx.rds_rings[ring];
1240 err = netxen_nic_request_irq(adapter);
1242 dev_err(&pdev->
dev,
"%s: failed to setup interrupt\n",
1244 goto err_out_free_rxbuf;
1248 netxen_nic_init_coalesce_defaults(adapter);
1250 netxen_create_sysfs_entries(adapter);
1269 netxen_remove_sysfs_entries(adapter);
1273 netxen_nic_free_irq(adapter);
1274 netxen_napi_del(adapter);
1293 if (netif_running(netdev))
1294 __netxen_nic_down(adapter, netdev);
1296 netxen_nic_detach(adapter);
1298 if (netif_running(netdev)) {
1299 err = netxen_nic_attach(adapter);
1301 err = __netxen_nic_up(adapter, netdev);
1360 if (netxen_read_mac_addr(adapter))
1361 dev_warn(&pdev->
dev,
"failed to read mac addr\n");
1367 dev_err(&pdev->
dev,
"failed to register net device\n");
1374 #ifdef CONFIG_PCIEAER
1375 static void netxen_mask_aer_correctable(
struct netxen_adapter *adapter)
1411 pr_warning(
"%s: chip revisions between 0x%x-0x%x "
1412 "will not be enabled.\n",
1422 goto err_out_disable_pdev;
1426 goto err_out_disable_pdev;
1436 goto err_out_free_res;
1441 adapter = netdev_priv(netdev);
1444 adapter->
ahw.pci_func = pci_func_id;
1447 adapter->
ahw.revision_id = revision_id;
1453 INIT_LIST_HEAD(&adapter->
mac_list);
1456 err = netxen_setup_pci_map(adapter);
1458 goto err_out_free_netdev;
1461 adapter->
portnum = pci_func_id;
1465 dev_err(&pdev->
dev,
"Error getting board config info.\n");
1466 goto err_out_iounmap;
1469 #ifdef CONFIG_PCIEAER
1470 netxen_mask_aer_correctable(adapter);
1474 switch (adapter->
ahw.board_type) {
1477 if (pci_func_id >= 2)
1478 adapter->
portnum = pci_func_id - 2;
1486 goto err_out_iounmap;
1490 if (val != 0xffffffff && val != 0) {
1496 err = netxen_start_firmware(adapter);
1498 goto err_out_decr_ref;
1506 if (i != 0x55555555)
1512 netxen_setup_intr(adapter);
1514 err = netxen_setup_netdev(adapter, netdev);
1516 goto err_out_disable_msi;
1518 pci_set_drvdata(pdev, adapter);
1520 netxen_schedule_work(adapter, netxen_fw_poll_work,
FW_POLL_DELAY);
1522 switch (adapter->
ahw.port_type) {
1524 dev_info(&adapter->
pdev->dev,
"%s: GbE port initialized\n",
1528 dev_info(&adapter->
pdev->dev,
"%s: XGbE port initialized\n",
1533 netxen_create_diag_entries(adapter);
1537 err_out_disable_msi:
1538 netxen_teardown_intr(adapter);
1543 nx_decr_dev_ref_cnt(adapter);
1546 netxen_cleanup_pci_map(adapter);
1548 err_out_free_netdev:
1554 err_out_disable_pdev:
1555 pci_set_drvdata(pdev,
NULL);
1566 if (adapter->
mdump.md_capture_buff) {
1577 adapter = pci_get_drvdata(pdev);
1578 if (adapter ==
NULL)
1581 netdev = adapter->
netdev;
1583 netxen_cancel_fw_work(adapter);
1589 netxen_free_vlan_ip_list(adapter);
1590 netxen_nic_detach(adapter);
1592 nx_decr_dev_ref_cnt(adapter);
1599 netxen_teardown_intr(adapter);
1601 netxen_remove_diag_entries(adapter);
1603 netxen_cleanup_pci_map(adapter);
1608 netxen_cleanup_minidump(adapter);
1614 pci_set_drvdata(pdev,
NULL);
1619 static void netxen_nic_detach_func(
struct netxen_adapter *adapter)
1625 netxen_cancel_fw_work(adapter);
1627 if (netif_running(netdev))
1628 netxen_nic_down(adapter, netdev);
1632 netxen_nic_detach(adapter);
1637 nx_decr_dev_ref_cnt(adapter);
1642 static int netxen_nic_attach_func(
struct pci_dev *pdev)
1656 adapter->
ahw.crb_win = -1;
1657 adapter->
ahw.ocm_win = -1;
1659 err = netxen_start_firmware(adapter);
1661 dev_err(&pdev->
dev,
"failed to start firmware\n");
1665 if (netif_running(netdev)) {
1666 err = netxen_nic_attach(adapter);
1670 err = netxen_nic_up(adapter, netdev);
1672 goto err_out_detach;
1674 netxen_restore_indev_addr(netdev,
NETDEV_UP);
1678 netxen_schedule_work(adapter, netxen_fw_poll_work,
FW_POLL_DELAY);
1682 netxen_nic_detach(adapter);
1684 nx_decr_dev_ref_cnt(adapter);
1696 if (nx_dev_request_aer(adapter))
1699 netxen_nic_detach_func(adapter);
1710 err = netxen_nic_attach_func(pdev);
1715 static void netxen_io_resume(
struct pci_dev *pdev)
1720 static void netxen_nic_shutdown(
struct pci_dev *pdev)
1724 netxen_nic_detach_func(adapter);
1744 netxen_nic_detach_func(adapter);
1762 netxen_nic_resume(
struct pci_dev *pdev)
1764 return netxen_nic_attach_func(pdev);
1768 static int netxen_nic_open(
struct net_device *netdev)
1776 err = netxen_nic_attach(adapter);
1780 err = __netxen_nic_up(adapter, netdev);
1784 netif_start_queue(netdev);
1789 netxen_nic_detach(adapter);
1796 static int netxen_nic_close(
struct net_device *netdev)
1800 __netxen_nic_down(adapter, netdev);
1814 int copied,
offset, copy_len,
hdr_len = 0, tso = 0, vlan_oob = 0;
1832 skb_shinfo(skb)->gso_size > 0) {
1834 hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
1854 l4proto = ip_hdr(skb)->protocol;
1861 l4proto = ipv6_hdr(skb)->nexthdr;
1894 skb_copy_from_linear_data(skb, vh, 12);
1897 skb_copy_from_linear_data_offset(skb, 12,
1898 (
char *)vh + 16, copy_len - 16);
1906 while (copied < hdr_len) {
1909 (hdr_len - copied));
1914 skb_copy_from_linear_data_offset(skb, copied,
1915 (
char *)hwdesc + offset, copy_len);
1928 netxen_map_tx_skb(
struct pci_dev *pdev,
1936 nr_frags = skb_shinfo(skb)->nr_frags;
1939 map = pci_map_single(pdev, skb->
data,
1941 if (pci_dma_mapping_error(pdev, map))
1945 nf->
length = skb_headlen(skb);
1947 for (i = 0; i < nr_frags; i++) {
1948 frag = &skb_shinfo(skb)->frags[
i];
1951 map = skb_frag_dma_map(&pdev->
dev, frag, 0, skb_frag_size(frag),
1957 nf->
length = skb_frag_size(frag);
1976 netxen_clear_cmddesc(
u64 *
desc)
1996 int frag_count, no_of_desc;
1999 frag_count = skb_shinfo(skb)->nr_frags + 1;
2007 frag = &skb_shinfo(skb)->frags[
i];
2008 delta += skb_frag_size(frag);
2014 frag_count = 1 + skb_shinfo(skb)->nr_frags;
2017 no_of_desc = (frag_count + 3) >> 2;
2020 netif_stop_queue(netdev);
2023 netif_start_queue(netdev);
2031 pdev = adapter->
pdev;
2033 if (netxen_map_tx_skb(pdev, skb, pbuf))
2039 first_desc = hwdesc = &tx_ring->
desc_head[producer];
2040 netxen_clear_cmddesc((
u64 *)hwdesc);
2045 for (i = 0; i < frag_count; i++) {
2049 if ((k == 0) && (i > 0)) {
2053 netxen_clear_cmddesc((
u64 *)hwdesc);
2078 netxen_tso_check(netdev, tx_ring, first_desc, skb);
2080 adapter->
stats.txbytes += skb->
len;
2081 adapter->
stats.xmitcalled++;
2088 adapter->
stats.txdropped++;
2106 "%s: Device temperature %d degrees C exceeds"
2107 " maximum allowed. Hardware has been shut down.\n",
2108 netdev->
name, temp_val);
2113 "%s: Device temperature %d degrees C "
2114 "exceeds operating range."
2115 " Immediate action needed.\n",
2116 netdev->
name, temp_val);
2121 "%s: Device temperature is now %d degrees C"
2122 " in normal range.\n", netdev->
name,
2126 adapter->
temp = temp_state;
2134 if (adapter->
ahw.linkup && !linkup) {
2137 adapter->
ahw.linkup = 0;
2138 if (netif_running(netdev)) {
2140 netif_stop_queue(netdev);
2143 }
else if (!adapter->
ahw.linkup && linkup) {
2146 adapter->
ahw.linkup = 1;
2147 if (netif_running(netdev)) {
2149 netif_wake_queue(netdev);
2155 static void netxen_nic_handle_phy_intr(
struct netxen_adapter *adapter)
2167 val = (val >> port*8) & 0xff;
2174 static void netxen_tx_timeout(
struct net_device *netdev)
2181 dev_err(&netdev->
dev,
"transmit timeout, resetting.\n");
2190 if (!netif_running(adapter->
netdev))
2202 netxen_napi_disable(adapter);
2204 netxen_napi_enable(adapter);
2206 netif_wake_queue(adapter->
netdev);
2258 unsigned long our_int = 0;
2270 netxen_nic_disable_int(sds_ring);
2278 napi_schedule(&sds_ring->
napi);
2283 static irqreturn_t netxen_msi_intr(
int irq,
void *data)
2291 napi_schedule(&sds_ring->
napi);
2295 static irqreturn_t netxen_msix_intr(
int irq,
void *data)
2299 napi_schedule(&sds_ring->
napi);
2317 if ((work_done < budget) && tx_complete) {
2320 netxen_nic_enable_int(sds_ring);
2326 #ifdef CONFIG_NET_POLL_CONTROLLER
2327 static void netxen_nic_poll_controller(
struct net_device *netdev)
2337 netxen_intr(adapter->
irq, sds_ring);
2431 nx_incr_dev_ref_cnt(adapter);
2477 if (netif_running(netdev)) {
2478 err = netxen_nic_attach(adapter);
2482 err = netxen_nic_up(adapter, netdev);
2484 netxen_nic_detach(adapter);
2488 netxen_restore_indev_addr(netdev,
NETDEV_UP);
2496 netxen_schedule_work(adapter, netxen_fw_poll_work,
FW_POLL_DELAY);
2511 if (adapter->
mdump.md_enabled) {
2531 switch (dev_state) {
2534 if (!netxen_start_firmware(adapter)) {
2535 netxen_schedule_work(adapter, netxen_attach_work, 0);
2542 netxen_schedule_work(adapter,
2548 nx_incr_dev_ref_cnt(adapter);
2558 dev_err(&adapter->
pdev->dev,
"%s: Device initialization Failed\n",
2575 netxen_nic_down(adapter, netdev);
2578 netxen_nic_detach(adapter);
2590 ref_cnt = nx_decr_dev_ref_cnt(adapter);
2592 if (ref_cnt == -
EIO)
2598 netxen_schedule_work(adapter, netxen_fwinit_work,
delay);
2617 if (netxen_nic_check_temp(adapter))
2641 if (heartbit != adapter->
heartbit) {
2657 dev_err(&netdev->
dev,
"firmware hang detected\n");
2659 dev_err(&adapter->
pdev->dev,
"Dumping hw/fw registers\n"
2660 "PEG_HALT_STATUS1: 0x%x, PEG_HALT_STATUS2: 0x%x,\n"
2661 "PEG_NET_0_PC: 0x%x, PEG_NET_1_PC: 0x%x,\n"
2662 "PEG_NET_2_PC: 0x%x, PEG_NET_3_PC: 0x%x,\n"
2663 "PEG_NET_4_PC: 0x%x\n",
2673 "Firmware aborted with error code 0x00006700. "
2674 "Device is being reset.\n");
2678 netxen_schedule_work(adapter, netxen_detach_work, 0);
2694 netxen_nic_handle_phy_intr(adapter);
2701 if (netxen_check_health(adapter))
2705 netxen_schedule_work(adapter, netxen_fw_poll_work,
FW_POLL_DELAY);
2709 netxen_store_bridged_mode(
struct device *dev,
2734 netxen_show_bridged_mode(
struct device *dev,
2739 int bridged_mode = 0;
2741 adapter = netdev_priv(net);
2746 return sprintf(buf,
"%d\n", bridged_mode);
2751 .
show = netxen_show_bridged_mode,
2752 .
store = netxen_store_bridged_mode,
2756 netxen_store_diag_mode(
struct device *dev,
2772 netxen_show_diag_mode(
struct device *dev,
2783 .
show = netxen_show_diag_mode,
2784 .
store = netxen_store_diag_mode,
2789 loff_t offset,
size_t size)
2791 size_t crb_size = 4;
2807 if ((size != crb_size) || (offset & (crb_size-1)))
2814 netxen_sysfs_read_crb(
struct file *filp,
struct kobject *kobj,
2816 char *buf, loff_t offset,
size_t size)
2824 ret = netxen_sysfs_validate_crb(adapter, offset, size);
2832 memcpy(buf, &qmdata, size);
2834 data =
NXRD32(adapter, offset);
2835 memcpy(buf, &data, size);
2842 netxen_sysfs_write_crb(
struct file *filp,
struct kobject *kobj,
2844 char *buf, loff_t offset,
size_t size)
2852 ret = netxen_sysfs_validate_crb(adapter, offset, size);
2859 memcpy(&qmdata, buf, size);
2862 memcpy(&data, buf, size);
2863 NXWR32(adapter, offset, data);
2871 loff_t offset,
size_t size)
2876 if ((size != 8) || (offset & 0x7))
2883 netxen_sysfs_read_mem(
struct file *filp,
struct kobject *kobj,
2885 char *buf, loff_t offset,
size_t size)
2892 ret = netxen_sysfs_validate_mem(adapter, offset, size);
2899 memcpy(buf, &data, size);
2906 loff_t offset,
size_t size)
2913 ret = netxen_sysfs_validate_mem(adapter, offset, size);
2917 memcpy(&data, buf, size);
2929 .
read = netxen_sysfs_read_crb,
2930 .
write = netxen_sysfs_write_crb,
2936 .
read = netxen_sysfs_read_mem,
2937 .
write = netxen_sysfs_write_mem,
2941 netxen_sysfs_read_dimm(
struct file *filp,
struct kobject *kobj,
2943 char *buf, loff_t offset,
size_t size)
2953 netdev_err(netdev,
"Invalid size\n");
2962 netdev_err(netdev,
"Invalid DIMM flag\n");
2963 dimm.presence = 0xff;
2976 if (!dimm.presence) {
2977 netdev_err(netdev,
"DIMM not present\n");
2983 switch (dimm.dimm_type) {
2992 netdev_err(netdev,
"Invalid DIMM type %x\n", dimm.dimm_type);
3007 netdev_err(netdev,
"Invalid no of rows %x\n", rows);
3012 netdev_err(netdev,
"Invalid no of columns %x\n", cols);
3017 netdev_err(netdev,
"Invalid no of banks %x\n", banks);
3049 netdev_err(netdev,
"Invalid data-width %x\n", dw);
3053 dimm.size = ((1 <<
rows) * (1 << cols) * dw * banks * ranks) / 8;
3055 dimm.size = (dimm.size) / 0x100000;
3065 .
read = netxen_sysfs_read_dimm,
3078 "failed to create bridged_mode sysfs entry\n");
3100 dev_info(dev,
"failed to create diag_mode sysfs entry\n");
3102 dev_info(dev,
"failed to create crb sysfs entry\n");
3104 dev_info(dev,
"failed to create mem sysfs entry\n");
3106 dev_info(dev,
"failed to create dimm sysfs entry\n");
3124 #define is_netxen_netdev(dev) (dev->netdev_ops == &netxen_netdev_ops)
3132 if (adapter->
ahw.cut_through)
3144 while (!list_empty(head)) {
3154 struct in_ifaddr *ifa,
unsigned long event)
3160 dev = ifa->ifa_dev ? ifa->ifa_dev->
dev :
NULL;
3165 if (!is_vlan_dev(dev))
3173 if (cur->
ip_addr == ifa->ifa_address)
3184 cur->
ip_addr = ifa->ifa_address;
3190 if (cur->
ip_addr == ifa->ifa_address) {
3202 struct in_device *indev;
3204 if (!netxen_destip_supported(adapter))
3207 indev = in_dev_get(dev);
3216 netxen_list_config_vlan_ip(adapter, ifa,
NX_IP_UP);
3221 netxen_list_config_vlan_ip(adapter, ifa,
NX_IP_DOWN);
3226 } endfor_ifa(indev);
3232 netxen_restore_indev_addr(
struct net_device *netdev,
unsigned long event)
3240 netxen_config_indev_addr(adapter, netdev, event);
3248 unsigned long event,
void *
ptr)
3263 if (!is_netxen_netdev(dev))
3266 adapter = netdev_priv(dev);
3274 netxen_config_indev_addr(adapter, orig_dev, event);
3281 unsigned long event,
void *ptr)
3286 struct in_ifaddr *ifa = (
struct in_ifaddr *)ptr;
3288 dev = ifa->ifa_dev ? ifa->ifa_dev->
dev :
NULL;
3299 if (!is_netxen_netdev(dev))
3302 adapter = netdev_priv(dev);
3304 if (!adapter || !netxen_destip_supported(adapter))
3313 netxen_list_config_vlan_ip(adapter, ifa,
NX_IP_UP);
3317 netxen_list_config_vlan_ip(adapter, ifa,
NX_IP_DOWN);
3336 netxen_restore_indev_addr(
struct net_device *dev,
unsigned long event)
3344 .error_detected = netxen_io_error_detected,
3345 .slot_reset = netxen_io_slot_reset,
3346 .resume = netxen_io_resume,
3351 .id_table = netxen_pci_tbl,
3352 .probe = netxen_nic_probe,
3355 .suspend = netxen_nic_suspend,
3356 .resume = netxen_nic_resume,
3358 .shutdown = netxen_nic_shutdown,
3359 .err_handler = &netxen_err_handler
3362 static int __init netxen_init_module(
void)
3370 return pci_register_driver(&netxen_driver);
3375 static void __exit netxen_exit_module(
void)