Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 313849 Details for
Bug 457958
Backport NetXen nic driver from upstream kernel to RHEL5.3
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch 1
rhl53.patchset2.p2.p19-p29.patch (text/plain), 26.79 KB, created by
Dhananjay Phadke
on 2008-08-08 21:25:09 UTC
(
hide
)
Description:
Patch 1
Filename:
MIME Type:
Creator:
Dhananjay Phadke
Created:
2008-08-08 21:25:09 UTC
Size:
26.79 KB
patch
obsolete
>diff -r --new-file -pu rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_ethtool.c rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_ethtool.c >--- rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_ethtool.c 2008-07-22 11:16:00.124359000 -0700 >+++ rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_ethtool.c 2008-07-22 14:53:22.976335000 -0700 >@@ -371,7 +371,7 @@ netxen_nic_get_regs(struct net_device *d > for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) { > /* GB: port specific registers */ > if (mode == 0 && i >= 19) >- window = physical_port[adapter->portnum] * >+ window = adapter->physical_port * > NETXEN_NIC_PORT_WINDOW; > > NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode]. >@@ -529,7 +529,7 @@ netxen_nic_get_pauseparam(struct net_dev > { > struct netxen_adapter *adapter = netdev_priv(dev); > __u32 val; >- int port = physical_port[adapter->portnum]; >+ int port = adapter->physical_port; > > if (adapter->ahw.board_type == NETXEN_NIC_GBE) { > if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) >@@ -575,7 +575,7 @@ netxen_nic_set_pauseparam(struct net_dev > { > struct netxen_adapter *adapter = netdev_priv(dev); > __u32 val; >- int port = physical_port[adapter->portnum]; >+ int port = adapter->physical_port; > /* read mode */ > if (adapter->ahw.board_type == NETXEN_NIC_GBE) { > if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) >diff -r --new-file -pu rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic.h rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic.h >--- rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic.h 2008-07-22 11:16:00.130356000 -0700 >+++ rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic.h 2008-07-22 14:53:23.161343000 -0700 >@@ -95,23 +95,6 @@ > > #define ADDR_IN_WINDOW1(off) \ > ((off > NETXEN_CRB_PCIX_HOST2) && (off < NETXEN_CRB_MAX)) ? 1 : 0 >-/* >- * In netxen_nic_down(), we must wait for any pending callback requests into >- * netxen_watchdog_task() to complete; eg otherwise the watchdog_timer could be >- * reenabled right after it is deleted in netxen_nic_down(). FLUSH_SCHEDULED_WORK() >- * does this synchronization. >- * >- * Normally, schedule_work()/flush_scheduled_work() could have worked, but >- * netxen_nic_close() is invoked with kernel rtnl lock held. netif_carrier_off() >- * call in netxen_nic_close() triggers a schedule_work(&linkwatch_work), and a >- * subsequent call to flush_scheduled_work() in netxen_nic_down() would cause >- * linkwatch_event() to be executed which also attempts to acquire the rtnl >- * lock thus causing a deadlock. >- */ >- >-#define SCHEDULE_WORK(tp) queue_work(netxen_workq, tp) >-#define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq) >-extern struct workqueue_struct *netxen_workq; > > /* > * normalize a 64MB crb address to 32MB PCI window >@@ -791,7 +774,6 @@ struct netxen_hardware_context { > > u8 revision_id; > u16 board_type; >- u16 max_ports; > struct netxen_board_info boardcfg; > u32 xg_linkup; > u32 qg_linksup; >@@ -877,6 +859,7 @@ struct netxen_adapter { > unsigned char mac_addr[ETH_ALEN]; > int mtu; > int portnum; >+ u8 physical_port; > > struct work_struct watchdog_task; > struct timer_list watchdog_timer; >@@ -1079,7 +1062,6 @@ void netxen_nic_isr_other(struct netxen_ > void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 link); > void netxen_handle_port_int(struct netxen_adapter *adapter, u32 enable); > void netxen_initialize_adapter_sw(struct netxen_adapter *adapter); >-void netxen_initialize_adapter_hw(struct netxen_adapter *adapter); > void *netxen_alloc(struct pci_dev *pdev, size_t sz, dma_addr_t * ptr, > struct pci_dev **used_dev); > void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); >@@ -1124,20 +1106,6 @@ static const struct netxen_brdinfo netxe > > #define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(struct netxen_brdinfo)) > >-static inline void get_brd_port_by_type(u32 type, int *ports) >-{ >- int i, found = 0; >- for (i = 0; i < NUM_SUPPORTED_BOARDS; ++i) { >- if (netxen_boards[i].brdtype == type) { >- *ports = netxen_boards[i].ports; >- found = 1; >- break; >- } >- } >- if (!found) >- *ports = 0; >-} >- > static inline void get_brd_name_by_type(u32 type, char *name) > { > int i, found = 0; >@@ -1216,5 +1184,4 @@ extern int netxen_rom_fast_read(struct n > > extern struct ethtool_ops netxen_nic_ethtool_ops; > >-extern int physical_port[]; /* physical port # from virtual port.*/ > #endif /* __NETXEN_NIC_H_ */ >diff -r --new-file -pu rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_hdr.h rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_hdr.h >--- rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_hdr.h 2008-07-22 11:16:00.136355000 -0700 >+++ rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_hdr.h 2008-07-22 14:53:23.168342000 -0700 >@@ -34,7 +34,6 @@ > #include <linux/kernel.h> > #include <linux/version.h> > >-#include <asm/semaphore.h> > #include <linux/spinlock.h> > #include <asm/irq.h> > #include <linux/init.h> >diff -r --new-file -pu rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_hw.c rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_hw.c >--- rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_hw.c 2008-07-22 11:16:00.144355000 -0700 >+++ rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_hw.c 2008-07-22 14:53:22.982335000 -0700 >@@ -392,11 +392,8 @@ int netxen_nic_hw_resources(struct netxe > } > adapter->intr_scheme = readl( > NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_FW)); >- printk(KERN_NOTICE "%s: FW capabilities:0x%x\n", netxen_nic_driver_name, >- adapter->intr_scheme); > adapter->msi_mode = readl( > NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_MSI_MODE_FW)); >- DPRINTK(INFO, "Receive Peg ready too. starting stuff\n"); > > addr = netxen_alloc(adapter->ahw.pdev, > sizeof(struct netxen_ring_ctx) + >@@ -404,8 +401,6 @@ int netxen_nic_hw_resources(struct netxe > (dma_addr_t *) & adapter->ctx_desc_phys_addr, > &adapter->ctx_desc_pdev); > >- printk(KERN_INFO "ctx_desc_phys_addr: 0x%llx\n", >- (unsigned long long) adapter->ctx_desc_phys_addr); > if (addr == NULL) { > DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); > err = -ENOMEM; >@@ -425,8 +420,6 @@ int netxen_nic_hw_resources(struct netxe > adapter->max_tx_desc_count, > (dma_addr_t *) & hw->cmd_desc_phys_addr, > &adapter->ahw.cmd_desc_pdev); >- printk(KERN_INFO "cmd_desc_phys_addr: 0x%llx\n", >- (unsigned long long) hw->cmd_desc_phys_addr); > > if (addr == NULL) { > DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); >@@ -1028,15 +1021,15 @@ int netxen_nic_get_board_info(struct net > int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) > { > netxen_nic_write_w0(adapter, >- NETXEN_NIU_GB_MAX_FRAME_SIZE( >- physical_port[adapter->portnum]), new_mtu); >+ NETXEN_NIU_GB_MAX_FRAME_SIZE(adapter->physical_port), >+ new_mtu); > return 0; > } > > int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) > { > new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; >- if (physical_port[adapter->portnum] == 0) >+ if (adapter->physical_port == 0) > netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, > new_mtu); > else >@@ -1047,7 +1040,7 @@ int netxen_nic_set_mtu_xgb(struct netxen > > void netxen_nic_init_niu_gb(struct netxen_adapter *adapter) > { >- netxen_niu_gbe_init_port(adapter, physical_port[adapter->portnum]); >+ netxen_niu_gbe_init_port(adapter, adapter->physical_port); > } > > void >@@ -1123,79 +1116,71 @@ void netxen_nic_set_link_parameters(stru > > void netxen_nic_flash_print(struct netxen_adapter *adapter) > { >- int valid = 1; > u32 fw_major = 0; > u32 fw_minor = 0; > u32 fw_build = 0; > char brd_name[NETXEN_MAX_SHORT_NAME]; >- struct netxen_new_user_info user_info; >- int i, addr = NETXEN_USER_START; >+ char serial_num[32]; >+ int i, addr; > __le32 *ptr32; > > struct netxen_board_info *board_info = &(adapter->ahw.boardcfg); >- if (board_info->magic != NETXEN_BDINFO_MAGIC) { >- printk >- ("NetXen Unknown board config, Read 0x%x expected as 0x%x\n", >- board_info->magic, NETXEN_BDINFO_MAGIC); >- valid = 0; >- } >- if (board_info->header_version != NETXEN_BDINFO_VERSION) { >- printk("NetXen Unknown board config version." >- " Read %x, expected %x\n", >- board_info->header_version, NETXEN_BDINFO_VERSION); >- valid = 0; >- } >- if (valid) { >- ptr32 = (u32 *) & user_info; >- for (i = 0; >- i < sizeof(struct netxen_new_user_info) / sizeof(u32); >- i++) { >- if (netxen_rom_fast_read(adapter, addr, ptr32) == -1) { >- printk("%s: ERROR reading %s board userarea.\n", >- netxen_nic_driver_name, >- netxen_nic_driver_name); >- return; >- } >- ptr32++; >- addr += sizeof(u32); >+ >+ adapter->driver_mismatch = 0; >+ >+ ptr32 = (u32 *)&serial_num; >+ addr = NETXEN_USER_START + >+ offsetof(struct netxen_new_user_info, serial_num); >+ for (i = 0; i < 8; i++) { >+ if (netxen_rom_fast_read(adapter, addr, ptr32) == -1) { >+ printk("%s: ERROR reading %s board userarea.\n", >+ netxen_nic_driver_name, >+ netxen_nic_driver_name); >+ adapter->driver_mismatch = 1; >+ return; > } >- get_brd_name_by_type(board_info->board_type, brd_name); >+ ptr32++; >+ addr += sizeof(u32); >+ } > >- printk("NetXen %s Board S/N %s Chip id 0x%x\n", >- brd_name, user_info.serial_num, board_info->chip_id); >+ fw_major = readl(NETXEN_CRB_NORMALIZE(adapter, >+ NETXEN_FW_VERSION_MAJOR)); >+ fw_minor = readl(NETXEN_CRB_NORMALIZE(adapter, >+ NETXEN_FW_VERSION_MINOR)); >+ fw_build = >+ readl(NETXEN_CRB_NORMALIZE(adapter, NETXEN_FW_VERSION_SUB)); > >- printk("NetXen %s Board #%d, Chip id 0x%x\n", >- board_info->board_type == 0x0b ? "XGB" : "GBE", >- board_info->board_num, board_info->chip_id); >- fw_major = readl(NETXEN_CRB_NORMALIZE(adapter, >- NETXEN_FW_VERSION_MAJOR)); >- fw_minor = readl(NETXEN_CRB_NORMALIZE(adapter, >- NETXEN_FW_VERSION_MINOR)); >- fw_build = >- readl(NETXEN_CRB_NORMALIZE(adapter, NETXEN_FW_VERSION_SUB)); >+ if (adapter->portnum == 0) { >+ get_brd_name_by_type(board_info->board_type, brd_name); > >- printk("NetXen Firmware version %d.%d.%d\n", fw_major, fw_minor, >- fw_build); >+ printk("NetXen %s Board S/N %s Chip id 0x%x\n", >+ brd_name, serial_num, board_info->chip_id); >+ printk("NetXen Firmware version %d.%d.%d\n", fw_major, >+ fw_minor, fw_build); > } >+ > if (fw_major != _NETXEN_NIC_LINUX_MAJOR) { >- printk(KERN_ERR "The mismatch in driver version and firmware " >- "version major number\n" >- "Driver version major number = %d \t" >- "Firmware version major number = %d \n", >- _NETXEN_NIC_LINUX_MAJOR, fw_major); > adapter->driver_mismatch = 1; > } > if (fw_minor != _NETXEN_NIC_LINUX_MINOR && > fw_minor != (_NETXEN_NIC_LINUX_MINOR + 1)) { >- printk(KERN_ERR "The mismatch in driver version and firmware " >- "version minor number\n" >- "Driver version minor number = %d \t" >- "Firmware version minor number = %d \n", >- _NETXEN_NIC_LINUX_MINOR, fw_minor); > adapter->driver_mismatch = 1; > } >- if (adapter->driver_mismatch) >- printk(KERN_INFO "Use the driver with version no %d.%d.xxx\n", >- fw_major, fw_minor); >+ if (adapter->driver_mismatch) { >+ printk(KERN_ERR "%s: driver and firmware version mismatch\n", >+ adapter->netdev->name); >+ return; >+ } >+ >+ switch (adapter->ahw.board_type) { >+ case NETXEN_NIC_GBE: >+ dev_info(&adapter->pdev->dev, "%s: GbE port initialized\n", >+ adapter->netdev->name); >+ break; >+ case NETXEN_NIC_XGBE: >+ dev_info(&adapter->pdev->dev, "%s: XGbE port initialized\n", >+ adapter->netdev->name); >+ break; >+ } > } > >diff -r --new-file -pu rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_init.c rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_init.c >--- rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_init.c 2008-07-22 11:16:00.156354000 -0700 >+++ rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_init.c 2008-07-22 14:53:22.988344000 -0700 >@@ -199,21 +199,6 @@ void netxen_initialize_adapter_sw(struct > } > } > >-void netxen_initialize_adapter_hw(struct netxen_adapter *adapter) >-{ >- int ports = 0; >- struct netxen_board_info *board_info = &(adapter->ahw.boardcfg); >- >- if (netxen_nic_get_board_info(adapter) != 0) >- printk("%s: Error getting board config info.\n", >- netxen_nic_driver_name); >- get_brd_port_by_type(board_info->board_type, &ports); >- if (ports == 0) >- printk(KERN_ERR "%s: Unknown board type\n", >- netxen_nic_driver_name); >- adapter->ahw.max_ports = ports; >-} >- > void netxen_initialize_adapter_ops(struct netxen_adapter *adapter) > { > switch (adapter->ahw.board_type) { >@@ -761,18 +746,13 @@ int netxen_flash_unlock(struct netxen_ad > > int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) > { >- int addr, val, status; >+ int addr, val; > int n, i; > int init_delay = 0; > struct crb_addr_pair *buf; > u32 off; > > /* resetall */ >- status = netxen_nic_get_board_info(adapter); >- if (status) >- printk("%s: netxen_pinit_from_rom: Error getting board info\n", >- netxen_nic_driver_name); >- > netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET, > NETXEN_ROMBUS_RESET); > >@@ -856,10 +836,10 @@ int netxen_pinit_from_rom(struct netxen_ > netxen_nic_pci_change_crbwindow(adapter, 1); > } > if (init_delay == 1) { >- msleep(2000); >+ msleep(1000); > init_delay = 0; > } >- msleep(20); >+ msleep(1); > } > kfree(buf); > >@@ -934,12 +914,28 @@ int netxen_initialize_adapter_offload(st > > void netxen_free_adapter_offload(struct netxen_adapter *adapter) > { >+ int i; >+ > if (adapter->dummy_dma.addr) { >- pci_free_consistent(adapter->ahw.pdev, >+ i = 100; >+ do { >+ if (dma_watchdog_shutdown_request(adapter) == 1) >+ break; >+ msleep(50); >+ if (dma_watchdog_shutdown_poll_result(adapter) == 1) >+ break; >+ } while (--i); >+ >+ if (i) { >+ pci_free_consistent(adapter->ahw.pdev, > NETXEN_HOST_DUMMY_DMA_SIZE, > adapter->dummy_dma.addr, > adapter->dummy_dma.phys_addr); >- adapter->dummy_dma.addr = NULL; >+ adapter->dummy_dma.addr = NULL; >+ } else { >+ printk(KERN_ERR "%s: dma_watchdog_shutdown failed\n", >+ adapter->netdev->name); >+ } > } > } > >@@ -1144,9 +1140,8 @@ u32 netxen_process_rcv_ring(struct netxe > consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); > count++; > } >- for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) { >+ for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) > netxen_post_rx_buffers_nodb(adapter, ctxid, ring); >- } > > /* update the consumer index in phantom */ > if (count) { >diff -r --new-file -pu rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_isr.c rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_isr.c >--- rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_isr.c 2008-07-22 11:16:00.159355000 -0700 >+++ rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_isr.c 2008-07-22 14:53:22.994345000 -0700 >@@ -142,7 +142,7 @@ void netxen_nic_isr_other(struct netxen_ > > /* verify the offset */ > val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); >- val = val >> physical_port[adapter->portnum]; >+ val = val >> adapter->physical_port; > if (val == adapter->ahw.qg_linksup) > return; > >@@ -169,6 +169,7 @@ void netxen_nic_gbe_handle_phy_intr(stru > netxen_nic_isr_other(adapter); > } > >+#if 0 > int netxen_nic_link_ok(struct netxen_adapter *adapter) > { > switch (adapter->ahw.board_type) { >@@ -186,6 +187,7 @@ int netxen_nic_link_ok(struct netxen_ada > > return 0; > } >+#endif /* 0 */ > > void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) > { >@@ -194,7 +196,7 @@ void netxen_nic_xgbe_handle_phy_intr(str > > /* WINDOW = 1 */ > val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); >- val >>= (physical_port[adapter->portnum] * 8); >+ val >>= (adapter->physical_port * 8); > val &= 0xff; > > if (adapter->ahw.xg_linkup == 1 && val != XG_LINK_UP) { >diff -r --new-file -pu rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_main.c rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_main.c >--- rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_main.c 2008-07-22 11:16:00.165358000 -0700 >+++ rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_main.c 2008-07-22 14:53:23.004340000 -0700 >@@ -75,23 +75,42 @@ static void netxen_nic_poll_controller(s > static irqreturn_t netxen_intr(int irq, void *data, struct pt_regs *regs); > static irqreturn_t netxen_msi_intr(int irq, void *data, struct pt_regs *regs); > >-int physical_port[] = {0, 1, 2, 3}; >- > /* PCI Device ID Table */ >+#define ENTRY(device) \ >+ {PCI_DEVICE(0x4040, (device)), \ >+ .class = PCI_CLASS_NETWORK_ETHERNET << 8, .class_mask = ~0} >+ > static struct pci_device_id netxen_pci_tbl[] __devinitdata = { >- {PCI_DEVICE(0x4040, 0x0001)}, >- {PCI_DEVICE(0x4040, 0x0002)}, >- {PCI_DEVICE(0x4040, 0x0003)}, >- {PCI_DEVICE(0x4040, 0x0004)}, >- {PCI_DEVICE(0x4040, 0x0005)}, >- {PCI_DEVICE(0x4040, 0x0024)}, >- {PCI_DEVICE(0x4040, 0x0025)}, >+ ENTRY(0x0001), >+ ENTRY(0x0002), >+ ENTRY(0x0003), >+ ENTRY(0x0004), >+ ENTRY(0x0005), >+ ENTRY(0x0024), >+ ENTRY(0x0025), > {0,} > }; > > MODULE_DEVICE_TABLE(pci, netxen_pci_tbl); > >-struct workqueue_struct *netxen_workq; >+/* >+ * In netxen_nic_down(), we must wait for any pending callback requests into >+ * netxen_watchdog_task() to complete; eg otherwise the watchdog_timer could be >+ * reenabled right after it is deleted in netxen_nic_down(). >+ * FLUSH_SCHEDULED_WORK() does this synchronization. >+ * >+ * Normally, schedule_work()/flush_scheduled_work() could have worked, but >+ * netxen_nic_close() is invoked with kernel rtnl lock held. netif_carrier_off() >+ * call in netxen_nic_close() triggers a schedule_work(&linkwatch_work), and a >+ * subsequent call to flush_scheduled_work() in netxen_nic_down() would cause >+ * linkwatch_event() to be executed which also attempts to acquire the rtnl >+ * lock thus causing a deadlock. >+ */ >+ >+static struct workqueue_struct *netxen_workq; >+#define SCHEDULE_WORK(tp) queue_work(netxen_workq, tp) >+#define FLUSH_SCHEDULED_WORK() flush_workqueue(netxen_workq) >+ > static void netxen_watchdog(unsigned long); > > static inline void netxen_nic_update_cmd_producer(struct netxen_adapter *adapter, >@@ -171,9 +190,8 @@ static void netxen_nic_disable_int(struc > int port = adapter->portnum; > int pci_fn = adapter->ahw.pci_func; > >- if (adapter->msi_mode != MSI_MODE_MULTIFUNC) { >+ if (adapter->msi_mode != MSI_MODE_MULTIFUNC) > writel(0x0, NETXEN_CRB_NORMALIZE(adapter, sw_int_mask[port])); >- } > > if (adapter->intr_scheme != -1 && > adapter->intr_scheme != INTR_SCHEME_PERPORT) >@@ -276,10 +294,11 @@ netxen_nic_probe(struct pci_dev *pdev, c > u32 val; > int pci_func_id = PCI_FUNC(pdev->devfn); > >- printk(KERN_INFO "%s \n", netxen_nic_driver_string); >+ if (pci_func_id == 0) >+ printk(KERN_INFO "%s \n", netxen_nic_driver_string); > > if (pdev->class != 0x020000) { >- printk(KERN_ERR"NetXen function %d, class %x will not" >+ printk(KERN_DEBUG "NetXen function %d, class %x will not " > "be enabled.\n",pci_func_id, pdev->class); > return -ENODEV; > } >@@ -443,8 +462,12 @@ netxen_nic_probe(struct pci_dev *pdev, c > */ > adapter->curr_window = 255; > >- /* initialize the adapter */ >- netxen_initialize_adapter_hw(adapter); >+ if (netxen_nic_get_board_info(adapter) != 0) { >+ printk("%s: Error getting board config info.\n", >+ netxen_nic_driver_name); >+ err = -EIO; >+ goto err_out_iounmap; >+ } > > /* > * Adapter in our case is quad port so initialize it before >@@ -523,17 +546,15 @@ netxen_nic_probe(struct pci_dev *pdev, c > netxen_initialize_adapter_sw(adapter); /* initialize the buffers in adapter */ > > /* Mezz cards have PCI function 0,2,3 enabled */ >- if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) >- && (pci_func_id >= 2)) >+ switch (adapter->ahw.boardcfg.board_type) { >+ case NETXEN_BRDTYPE_P2_SB31_10G_IMEZ: >+ case NETXEN_BRDTYPE_P2_SB31_10G_HMEZ: >+ if (pci_func_id >= 2) > adapter->portnum = pci_func_id - 2; >- >-#ifdef CONFIG_IA64 >- if(adapter->portnum == 0) { >- netxen_pinit_from_rom(adapter, 0); >- udelay(500); >- netxen_load_firmware(adapter); >+ break; >+ default: >+ break; > } >-#endif > > init_timer(&adapter->watchdog_timer); > adapter->ahw.xg_linkup = 0; >@@ -611,11 +632,18 @@ netxen_nic_probe(struct pci_dev *pdev, c > err = -ENODEV; > goto err_out_free_dev; > } >+ } else { >+ writel(0, NETXEN_CRB_NORMALIZE(adapter, >+ CRB_CMDPEG_STATE)); >+ netxen_pinit_from_rom(adapter, 0); >+ msleep(1); >+ netxen_load_firmware(adapter); >+ netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); > } > > /* clear the register for future unloads/loads */ > writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); >- printk(KERN_INFO "State: 0x%0x\n", >+ dev_info(&pdev->dev, "cmdpeg state: 0x%0x\n", > readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); > > /* >@@ -637,9 +665,10 @@ netxen_nic_probe(struct pci_dev *pdev, c > /* > * See if the firmware gave us a virtual-physical port mapping. > */ >+ adapter->physical_port = adapter->portnum; > i = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_V2P(adapter->portnum))); > if (i != 0x55555555) >- physical_port[adapter->portnum] = i; >+ adapter->physical_port = i; > > netif_carrier_off(netdev); > netif_stop_queue(netdev); >@@ -652,22 +681,9 @@ netxen_nic_probe(struct pci_dev *pdev, c > goto err_out_free_dev; > } > >+ netxen_nic_flash_print(adapter); > pci_set_drvdata(pdev, adapter); > >- switch (adapter->ahw.board_type) { >- case NETXEN_NIC_GBE: >- printk(KERN_INFO "%s: QUAD GbE board initialized\n", >- netxen_nic_driver_name); >- break; >- >- case NETXEN_NIC_XGBE: >- printk(KERN_INFO "%s: XGbE board initialized\n", >- netxen_nic_driver_name); >- break; >- } >- >- adapter->driver_mismatch = 0; >- > return 0; > > err_out_free_dev: >@@ -760,55 +776,8 @@ static void __devexit netxen_nic_remove( > > vfree(adapter->cmd_buf_arr); > >- if (adapter->portnum == 0) { >- if (init_firmware_done) { >- i = 100; >- do { >- if (dma_watchdog_shutdown_request(adapter) == 1) >- break; >- msleep(100); >- if (dma_watchdog_shutdown_poll_result(adapter) == 1) >- break; >- } while (--i); >- >- if (i == 0) >- printk(KERN_ERR "%s: dma_watchdog_shutdown failed\n", >- netdev->name); >- >- /* clear the register for future unloads/loads */ >- writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); >- printk(KERN_INFO "State: 0x%0x\n", >- readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); >- >- /* leave the hw in the same state as reboot */ >- writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); >- netxen_pinit_from_rom(adapter, 0); >- msleep(1); >- netxen_load_firmware(adapter); >- netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); >- } >- >- /* clear the register for future unloads/loads */ >- writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); >- printk(KERN_INFO "State: 0x%0x\n", >- readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); >- >- i = 100; >- do { >- if (dma_watchdog_shutdown_request(adapter) == 1) >- break; >- msleep(100); >- if (dma_watchdog_shutdown_poll_result(adapter) == 1) >- break; >- } while (--i); >- >- if (i) { >- netxen_free_adapter_offload(adapter); >- } else { >- printk(KERN_ERR "%s: dma_watchdog_shutdown failed\n", >- netdev->name); >- } >- } >+ if (adapter->portnum == 0) >+ netxen_free_adapter_offload(adapter); > > if (adapter->irq) > free_irq(adapter->irq, adapter); >@@ -840,13 +809,15 @@ static int netxen_nic_open(struct net_de > irq_handler_t handler; > unsigned long flags = IRQF_SAMPLE_RANDOM; > >+ if (adapter->driver_mismatch) >+ return -EIO; >+ > if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) { > err = netxen_init_firmware(adapter); > if (err != 0) { > printk(KERN_ERR "Failed to init firmware\n"); > return -EIO; > } >- netxen_nic_flash_print(adapter); > > /* setup all the resources for the Phantom... */ > /* this include the descriptors for rcv, tx, and status */ >@@ -895,13 +866,11 @@ static int netxen_nic_open(struct net_de > if (adapter->set_mtu) > adapter->set_mtu(adapter, netdev->mtu); > >- if (!adapter->driver_mismatch) >- mod_timer(&adapter->watchdog_timer, jiffies); >+ mod_timer(&adapter->watchdog_timer, jiffies); > > netxen_nic_enable_int(adapter); > >- if (!adapter->driver_mismatch) >- netif_start_queue(netdev); >+ netif_start_queue(netdev); > > return 0; > } >diff -r --new-file -pu rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_niu.c rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_niu.c >--- rhl53.p2.p01-p18/drivers/net/netxen/netxen_nic_niu.c 2008-07-22 11:16:00.170355000 -0700 >+++ rhl53.p2.p19-p29/drivers/net/netxen/netxen_nic_niu.c 2008-07-22 14:53:23.154343000 -0700 >@@ -94,7 +94,7 @@ int netxen_niu_gbe_phy_read(struct netxe > long timeout = 0; > long result = 0; > long restore = 0; >- long phy = physical_port[adapter->portnum]; >+ long phy = adapter->physical_port; > __u32 address; > __u32 command; > __u32 status; >@@ -190,7 +190,7 @@ int netxen_niu_gbe_phy_write(struct netx > long timeout = 0; > long result = 0; > long restore = 0; >- long phy = physical_port[adapter->portnum]; >+ long phy = adapter->physical_port; > __u32 address; > __u32 command; > __u32 status; >@@ -454,7 +454,7 @@ int netxen_niu_gbe_init_port(struct netx > > int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) > { >- u32 portnum = physical_port[adapter->portnum]; >+ u32 portnum = adapter->physical_port; > > netxen_crb_writelit_adapter(adapter, > NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), 0x1447); >@@ -569,7 +569,7 @@ int netxen_niu_macaddr_get(struct netxen > { > u32 stationhigh; > u32 stationlow; >- int phy = physical_port[adapter->portnum]; >+ int phy = adapter->physical_port; > u8 val[8]; > > if (addr == NULL) >@@ -600,7 +600,7 @@ int netxen_niu_macaddr_set(struct netxen > { > u8 temp[4]; > u32 val; >- int phy = physical_port[adapter->portnum]; >+ int phy = adapter->physical_port; > unsigned char mac_addr[6]; > int i; > >@@ -722,7 +722,7 @@ int netxen_niu_enable_gbe_port(struct ne > int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) > { > __u32 mac_cfg0; >- u32 port = physical_port[adapter->portnum]; >+ u32 port = adapter->physical_port; > > if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) > return -EINVAL; >@@ -738,7 +738,7 @@ int netxen_niu_disable_gbe_port(struct n > int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) > { > __u32 mac_cfg; >- u32 port = physical_port[adapter->portnum]; >+ u32 port = adapter->physical_port; > > if (port > NETXEN_NIU_MAX_XG_PORTS) > return -EINVAL; >@@ -755,7 +755,7 @@ int netxen_niu_set_promiscuous_mode(stru > netxen_niu_prom_mode_t mode) > { > __u32 reg; >- u32 port = physical_port[adapter->portnum]; >+ u32 port = adapter->physical_port; > > if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) > return -EINVAL; >@@ -812,7 +812,7 @@ int netxen_niu_set_promiscuous_mode(stru > int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, > netxen_ethernet_macaddr_t addr) > { >- int phy = physical_port[adapter->portnum]; >+ int phy = adapter->physical_port; > u8 temp[4]; > u32 val; > >@@ -864,7 +864,7 @@ int netxen_niu_xg_macaddr_set(struct net > int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, > netxen_ethernet_macaddr_t * addr) > { >- int phy = physical_port[adapter->portnum]; >+ int phy = adapter->physical_port; > u32 stationhigh; > u32 stationlow; > u8 val[8]; >@@ -892,7 +892,7 @@ int netxen_niu_xg_set_promiscuous_mode(s > netxen_niu_prom_mode_t mode) > { > __u32 reg; >- u32 port = physical_port[adapter->portnum]; >+ u32 port = adapter->physical_port; > > if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS)) > return -EINVAL;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 457958
:
313475
|
313476
|
313477
|
313478
|
313849
|
313850
|
313851
|
314419
|
314420
|
314421
|
315321