aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_main.c
Commit message (Collapse)AuthorAgeFilesLines
* netxen:fix napi intr enable checkAmit Kumar Salecha2009-12-081-2/+4
| | | | | | | | | | o netif_running() check for enabling interrupt at end of napi poll is not enough to cover firmwar recovery. Instead test __NX_DEV_UP bit. o Avoid re-entry into to netxen_nic_down() with __NX_DEV_UP bit check. Acked-by: Dhananjay Phadke <dhananjay.phadke@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: protect device reset by rtnl_lockAmit Kumar Salecha2009-12-081-8/+35
| | | | | | | | | | o To prevent race conditions with other reset events. During suspend/resume and firmware recovery, acquire rtnl_lock, while changing interface state. Acked-by: Dhananjay Phadke <dhananjay.phadke@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix failure cases for fw hang recoveryAmit Kumar Salecha2009-12-021-11/+15
| | | | | | | | | | | | | | | | | Handle few corner cases in firmware hang detection and recovery: o Don't mark device state as READY, till handshake with firmware is done. o During probe, if start_firmware fails, restore reference count. o Don't increment refernce count, if start_firmware fails during firmware reset. o Clear __NX_RESETTING bit, incase of fatal error or tempeature reaches critical limit so that pci remove() doesn't poll on this bit. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2009-11-291-1/+3
|\ | | | | | | | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/ieee802154/fakehard.c drivers/net/e1000e/ich8lan.c drivers/net/e1000e/phy.c drivers/net/netxen/netxen_nic_init.c drivers/net/wireless/ath/ath9k/main.c
| * netxen : fix BOND_MODE_TLB/ALB mode.Narender Kumar2009-11-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Along with netdev->perm_addr, mac address will be maintained in device private structure. o Device limitation: We need to set mac address when ever interface comes up. In ALB/TAL mode, bonding driver calls set_mac for all slave with bond mac address. But bonding driver set netdev->dev_addr field to its original value, after enslaving interfaces. When ever active slave changes, it swap dev_addr of inactive slave with active. Yet it doesn't notify driver about change in netdev->dev_addr. As netxen driver need to set mac addr when ever interface comes up, it can't rely on netdev->dev_addr field. Specially in case of bonding mode ALB/TLB. Signed-off-by: Narender Kumar <narender.kumar@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: remove PCI IDs of CNA deviceAmit Kumar Salecha2009-11-201-6/+0
| | | | | | | | | | | | | | | | Remove PCI vendor and device IDs for QLE8240 and QLE8242 CNA devices. CNA devices will have separate driver. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: module firmware hintsDhananjay Phadke2009-10-281-0/+4
| | | | | | | | | | | | | | | | Add MODULE_FIRMWARE hints for various firmware file types, required by different chip revisions. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: update module infoDhananjay Phadke2009-10-281-12/+6
| | | | | | | | | | | | | | Update module info with QLogic signature. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: add PCI IDs for new chipDhananjay Phadke2009-10-281-0/+6
| | | | | | | | | | | | | | | | Add PCI vendor and device IDs for QLE8240 and QLE8242 CNA devices. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: fix builds for SYSFS=n or MODULES=nRandy Dunlap2009-10-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_MODULES=n: drivers/net/netxen/netxen_nic_main.c:2751: error: dereferencing pointer to incomplete type drivers/net/netxen/netxen_nic_main.c:2764: error: dereferencing pointer to incomplete type Also needs addition of <linux/sysfs.h> for sysfs function prototypes or stubs when CONFIG_SYSFS=n. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2009-10-271-0/+1
|\ \ | |/ | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/sh_eth.c
| * netxen: fix tx timeout handling on firmware hangAmit Kumar Salecha2009-10-221-0/+1
| | | | | | | | | | | | | | | | | | | | Clear NX_RESETING bit in netxen_tx_timeout_task() so that the firmware watchdog task can catch need_reset request from tx timeout. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: sysfs control for auto firmware recoveryNarender Kumar2009-10-171-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | Firmware hang detection and recovery (reset) need to be disabled for diagnostic tools, which can run some disruptive tests. This adds a driver level control to turn off this feature by diag tools. Signed-off-by: Narender Kumar <narender.kumar@qlogic.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: onchip memory access changeAmit Kumar Salecha2009-10-171-1/+5
| | | | | | | | | | | | | | | | | | | | Add support for different windowing scheme for on chip memory in future chip revisions. This is required by diagnostic tools. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: reset sequence changesAmit Kumar Salecha2009-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | Future revisions need different chip reset sequence and firmware initialization. Also clean up some never used debug code. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2009-10-131-1/+2
|\ \ | |/ | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
| * netxen: fix pci bar mappingDhananjay Phadke2009-10-131-1/+2
| | | | | | | | | | | | | | | | | | Use resource_size_t for PCI resource remapping instead of unsigned long. Physical addresses can exceed range of long data type (e.g with PAE). Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: add sysfs entries for diag toolsDhananjay Phadke2009-10-131-0/+187
| | | | | | | | | | | | | | | | | | Add sysfs entries to enable register and memory access for diagnostic tools. Signed-off-by: Narender Kumar <narender.kumar@qlogic.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: separate register and memory access lockDhananjay Phadke2009-10-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | Since register and onboard memory access has separate window registers, they need not be kept under same lock. Also, memory is always accessed from process context (mostly for firmware init and diagnostic tools). Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: annotate register windowing codeDhananjay Phadke2009-10-131-2/+2
| | | | | | | | | | | | | | Use common variables crb_win, ocm_win for all revisions of chip. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: add access to on chip memory for toolsDhananjay Phadke2009-10-131-16/+8
| | | | | | | | | | | | | | | | Add access to on chip memory, this is used by debug and diagnostic tools only. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2009-10-111-1/+1
|\ \ | |/ | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
| * netxen: Fix Unlikely(x) > yRoel Kluin2009-10-071-1/+1
| | | | | | | | | | | | | | | | The closing parenthesis was not on the right location. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netxen: Use the instance of net_device_stats from net_device.Ajit Khaparde2009-10-071-1/+1
|/ | | | | | | | Since net_device has an instance of net_device_stats, we can remove the instance of this from the private adapter structure. Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix firmware init after resumeDhananjay Phadke2009-09-221-0/+1
| | | | | | | | | | After successful firmware init, return instead of falling to error path (leading to detach) after resuming to D0 state. This was broken in recent firmware reset rehaul. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix minor tx timeout bugDhananjay Phadke2009-09-221-4/+3
| | | | | | | | | | | Fix minor bug in netdev tx timeout handling which could always lead to firmware reset instead of pci function reset. netxen_nic_reset_context() requires __NX_RESETTING bit cleared. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: update copyrightDhananjay Phadke2009-09-111-6/+1
| | | | | | | | | o Add QLogic copyright, add linux-driver@qlogic.com to MAINTAINERS. o Delete old contact information. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix tx timeout recoveryAmit Kumar Salecha2009-09-111-11/+58
| | | | | | | | | | | | | | | | Redesign tx timeout handling in line with new firmware reset design that co-ordinates with other PCI function drivers. o For NX3031, first try to reset PCI function's own context before requesting firmware reset. o For NX2031, since firmware heartbit is not supported directly request firmware reset. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix file firmware leakDhananjay Phadke2009-09-111-2/+3
| | | | | | | Release file firmware when no firmware reset is required. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: improve pci memory accessDhananjay Phadke2009-09-111-3/+4
| | | | | | | | | | | | o Access on card memory through memory controller (agent) rather than moving small pci window around. Clean up the code for moving windows around. o Restrict memory accesss to 64 bit, currently only firmware download uses this. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: build fix for INET=nRandy Dunlap2009-09-111-0/+4
| | | | | | | | | | | | | When CONFIG_INET is disabled, netxen has a build failure: netxen_nic_main.c:(.text+0x118fd1): undefined reference to `netxen_config_indev_addr' so make that function just an empty stub when CONFIG_INET=n. (not "inline" since that conflicts with other declarations of it) Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix check for ip addr hashing supportAmit Kumar Salecha2009-09-091-1/+1
| | | | | | | | | Fix typo in checking dest ip has support before programming destip addresses. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: refactor firmware info codeDhananjay Phadke2009-09-071-43/+98
| | | | | | | | | o Combine netxen_get_firmware_info(), netxen_check_options() so that they are updated every time firmware is reset. o Set dma mask everytime firmware is reset. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: pre calculate register addressesAmit Kumar Salecha2009-09-071-49/+41
| | | | | | | | | | | For registers accessed in fast path (interrupt / softirq) avoid expensive I/O address translation. These registers are directly mapped in PCI bar 0 and do not require any window checks. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix ip addr hashing after firmware resetAmit Kumar Salecha2009-09-071-22/+39
| | | | | | | | | Reprogram local IP addresses after firmware is reset or after resuming from suspend. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: firmware hang detectionDhananjay Phadke2009-09-071-84/+304
| | | | | | | | | | | | | | | | | | | | | | | | Implement state machine to detect firmware hung state and recover. Since firmware will be shared by all PCI functions that have different class drivers (NIC or FCOE or iSCSI), explicit hardware based serialization is required for initializing firmware. o Used global scratchpad register to maintain device reference count. Every probed pci function adds to ref count. o Implement timer (delayed work) for each pci func that checks firmware heartbit every 5 sec and detaches itself if firmware is dead. Last detaching function reloads firmware. Other functions wait for firmware init, and re-attach themselves. Heartbit is not supported by NX2031 firmware. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: handle firmware load errorsDhananjay Phadke2009-09-071-4/+16
| | | | | | | | Unwind allocations and release file firmware when when firmware load fails. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix infinite loop on dma mapping failureDhananjay Phadke2009-09-031-2/+2
| | | | | | | | | Fix a perpetual while() loop in unwinding partial mapped tx skb on dma mapping failure. Reported-by: "Juha Leppanen" <juha_motorsportcom@luukku.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: remove duplicate napi_addDhananjay Phadke2009-09-031-6/+0
| | | | | | | Remove duplicate calls to netxen_napi_add(). Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: convert bulk of drivers to netdev_tx_tStephen Hemminger2009-09-011-2/+3
| | | | | | | | | | | | In a couple of cases collapse some extra code like: int retval = NETDEV_TX_OK; ... return retval; into return NETDEV_TX_OK; Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: bridged mode optimizationsNarender Kumar2009-08-261-2/+82
| | | | | | | | | | | | | | | | | | | When the interface is put in bridged mode, destination mac addresses are unknown to firmware. So packets take a slow path (lower priority) in firmware reducing performance. Firmware can cache limited number of remote unicast mac addresses for certain interval, if "dynamic mac learning" mode is enabled. Driver needs to enable this "mac learning" mode in firmware. Currently this is done through net device class sysfs entry, possibly this can also be done upon netlink notifications to from bridge. Signed-off-by: Narender Kumar <narender.kumar@qlogic.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: remove netxen_nic_phan_reg.hDhananjay Phadke2009-08-231-1/+0
| | | | | | | Consolidate register definitions in netxen_nic_hdr.h Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: implement pci driver shutdownAmit Kumar Salecha2009-08-231-8/+30
| | | | | | | | | Implement pci driver shutdown functionality, this helps quiescing all PCI transaction before chipset is reset. Amit Kumar Salecha <amit@qlogic.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: refactor tx dma mapping codeDhananjay Phadke2009-08-231-52/+60
| | | | | | | Move all tx skb mapping code into netxen_map_tx_skb(). Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: fix firmware reset logicDhananjay Phadke2009-08-231-1/+3
| | | | | | | | If netxen_need_fw_reset() return 0 [ implies firmware is up and running], still go through dma mask check, etc. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netxen: ethtool statistics and control for LRONarender Kumar2009-08-231-1/+7
| | | | | | | | | | | | | Add ethtool -K knob to control LRO in firmware. LRO path is completely separated from GRO, LRO packets are still fed with netif_receive_skb(). Also fix ethtool statistics to include LRO packets. Also use correct message type while configuring interrupt coalescing. Signed-off-by: Narender Kumar <narender.kumar@qlogic.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2009-08-131-34/+65
|\ | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/netxen/netxen_nic_main.c
| * netxen: free napi resources during detachDhananjay Phadke2009-08-131-8/+24
| | | | | | | | | | | | | | | | | | | | | | o Defer napi resouce allocation to device attach. o Free napi resources and delete napi during detach. This ensures right behavior across firmware reset. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * netxen: remove netxen workqueueAmit Kumar Salecha2009-08-131-28/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Remove private workqueue in the driver, move all scheduled tasks to keventd workqueues. This makes ports (interfaces) of same / different NIC boards independent, in terms of their link watchdog and reset tasks. o Move quick checks for link status and temperature in timer callback, schedule watchdog task only if link status changed or temperature reached critical threshold. This also fixes deadlock when thermal panic occurs, watchdog work was flushing workqueue that it was sitting on. Signed-off-by: Amit Kumar Salecha <amit@qlogic.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2009-08-121-14/+27
|\ \ | |/ | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: arch/microblaze/include/asm/socket.h