aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_hw.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-07-20netxen: fix deadlock on dev closeDhananjay Phadke1-4/+5
netxen: fix deadlock on dev close The tx ring accounting fix in commit cb2107be43d2fc5eadec58b92b ("netxen: fix tx ring accounting") introduced intermittent deadlock when inteface is going down. This was possibly combined effect of speculative tx pause, calling netif_tx_lock instead of queue lock and unclean synchronization with napi which could end up unmasking interrupt. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-18netxen: fix tx ring accountingDhananjay Phadke1-1/+1
This forces every update of tx ring producer to check for availability of space for next full TSO command. Earlier firmware control commands didn't care to pause tx queue. Stop the tx queue if there's not enough space to transmit one full LSO command left on the tx ring after current transmit. This avoids returning NETDEV_TX_BUSY after checking distance between producer and consumer on every cpu. Restart the tx queue only if we have cleaned up enough tx descriptors. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-18netxen: fix detection of cut-thru firmware modeDhananjay Phadke1-2/+2
Fix the detection of cut-thru mode of the hardware (direct dma to host) to mode configured in SRE (ingress block) rather than onboard memory control. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-09netxen: trivial register access cleanupDhananjay Phadke1-8/+5
Remove unnecessary length parameter since it's always 4 bytes. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-06netxen: fix bonding supportDhananjay Phadke1-21/+7
o Pause traffic during mac addr change. o Enable setting mac address for NX3031. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-06netxen: fix mac list managementDhananjay Phadke1-73/+51
o use standard linked list api for mac addr list management in NX3031. o release mac addresses in firmware in dev close(). Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-06netxen: fix race in tx ring acccessDhananjay Phadke1-2/+2
Fix the distance check between tx ring producer and consumer that could lead to tx ring wrap around. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-28netxen: fix firmware downloadDhananjay Phadke1-195/+0
o hold the firmware in memory across suspend, since filesystem may not be up after resuming. o reset the chip after requesting firmware, to minimize downtime for NC-SI. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-28netxen: refactor netxen_recv_context structDhananjay Phadke1-1/+1
o move related fields into netxen_recv_context struct. o allocate rx buffer and descriptor rings dynamically. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08netxen: cache align register map tableDhananjay Phadke1-1/+2
Aligning register offset translation table imporves performance on rx side. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08netxen: sanitize function namesDhananjay Phadke1-130/+57
Replace superfluous wrapper functions with two macros: NXWR32 replaces netxen_nic_reg_write, netxen_nic_write_w0, netxen_nic_read_w1, netxen_crb_writelit_adapter. NXRD32 replaces netxen_nic_reg_read, netxen_nic_read_w0, netxen_nic_read_w1. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08netxen: annotate register access functionsDhananjay Phadke1-128/+101
o remove unnecessary length parameter since register access width is fixed 4 byte. o remove superfluous pci_read_normalize and pci_write_normalize functions. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08netxen: async link event handlingDhananjay Phadke1-0/+22
Add support for asynchronous events from firmware, received over one of the rx rings. Add support for event based phy interrupts, enhanced links status reporting from firmware. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08netxen: refactor transmit codeDhananjay Phadke1-19/+18
o move tx stuff into nx_host_tx_ring structure, this will help managing multiple tx rings in future. o sanitize some variable names Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08netxen: code cleanupDhananjay Phadke1-1/+16
o remove unused structure defs. o remove unnecessary includes. o replace enums with specific #defines. o reduce footprint of stats structure. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-17Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-22/+0
Conflicts: drivers/net/igb/igb_main.c drivers/net/qlge/qlge_main.c drivers/net/wireless/ath9k/ath9k.h drivers/net/wireless/ath9k/core.h drivers/net/wireless/ath9k/hw.c
2009-03-17netxen: fix firmware download warningsDhananjay Phadke1-12/+12
Fix following warnings, by using integer firmware types. drivers/net/netxen/netxen_nic_hw.c: In function 'netxen_load_firmware': drivers/net/netxen/netxen_nic_hw.c:1146: warning: comparison with string literal results in unspecified behavior drivers/net/netxen/netxen_nic_hw.c:1146: warning: comparison with string literal results in unspecified behavior drivers/net/netxen/netxen_nic_hw.c:1146: warning: comparison with string literal results in unspecified behavior drivers/net/netxen/netxen_nic_hw.c:1159: warning: comparison with string literal results in unspecified behavior drivers/net/netxen/netxen_nic_hw.c:1159: warning: comparison with string literal results in unspecified behavior drivers/net/netxen/netxen_nic_hw.c:1159: warning: comparison with string literal results in unspecified behavior Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14netxen: add receive side scaling (rss) supportDhananjay Phadke1-0/+47
This patch enables the load balancing capability of firmware and hardware to spray traffic into different cpus through separate rx msix interrupts. The feature is being enabled for NX3031, NX2031 (old) will be enabled later. This depends on msi-x and compatibility with msi and legacy is maintained by enabling single rx ring. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14netxen: sanitize variable namesDhananjay Phadke1-1/+1
o remove max_ prefix from ring sizes, since they don't really represent max possible sizes. o cleanup naming of rx ring types (normal, jumbo, lro). o simplify logic to choose rx ring size, gig ports get half rx ring of 10 gig ports. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14netxen: add suspend resume supportDhananjay Phadke1-0/+17
Detach network interface on PCI suspend and recreate hardware context after resumes. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14netxen: fix endianness in serial numberDhananjay Phadke1-6/+4
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14netxen: remove old flash check.Dhananjay Phadke1-22/+0
Remove flash size check which made sense only for ancient boards with 1MB flash. The check is based on values read from specific locations and fails with firmware size changes. This prevents driver from getting right mac addresses. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-10netxen: annotate board_config and board_typeDhananjay Phadke1-54/+54
Remove huge board config structure from each instance, read only necessary fields from flash. Replace board_type with port_type (1G/10G), there's another board_type field describing card type (SFP/XFP/CX4). Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-03netxen: firmware download improvementsDhananjay Phadke1-7/+20
o set port mode after resetting device. o prefer cut-through firmware (doesn't require on-card memory). o load flashed firmware if newer. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-27netxen: update copyrightDhananjay Phadke1-7/+4
Extend copyright into 2009 and update address. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-24netxen: cleanup unused codeDhananjay Phadke1-13/+0
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-24netxen: firmware download supportDhananjay Phadke1-11/+164
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-17netxen: ratelimit error printsDhananjay Phadke1-8/+12
If for some reason, read from card memory fails the console get flooded with failure prints. This patch confines print under printk_ratelimit(). Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-17netxen: fix sparse warningsDhananjay Phadke1-132/+47
Fix following sparse warnings (multiple instances) warning: restricted degrades to integer warning: cast to restricted type warning: incorrect type in argument 3 (different signedness) warning: context imbalance in 'netxen_nic_hw_write_wx_2M' - different lock contexts for basic block Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14netxen: hold tx lock while sending firmware commandsDhananjay Phadke1-0/+4
Some firmware commands like mac address addition/deletion are sent on the transmit ring. So need to hold the tx lock before touching tx producer/consumer indices. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14netxen: cleanup mac list on driver unloadDhananjay Phadke1-0/+13
This fixes a tiny memory leak when driver is unloaded. The mac address list maintained in netxen_adapter needs to deleted when driver is going down. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14netxen: firmware init fixDhananjay Phadke1-4/+2
o Fix order or rom register writes. o Reduce udelays when writing rom registers. This cuts the firmware init time by 40%. o Do not reset core/memory clocks when reinitializing driver. Firmware willl handle this when initialized. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14netxen: fix link speed reporting for some boardsDhananjay Phadke1-8/+20
o Read negotiated link speed when link state changes. o Fix link speed reporting for hybrid nic boards, which have both 1Gbps and 10Gbps ports. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14netxen: fix ipv6 offload and tx cleanupDhananjay Phadke1-4/+0
o fix the ip/tcp hdr offset in tx descriptors for ipv6. o cleanup xmit function, move the tso checks into separate function, this reduces unnecessary endian conversions back and forth. o optimize macros to initialize tx descriptors. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14netxen: fix endianness in firmware commandsDhananjay Phadke1-18/+24
o Set restricted (little endian) data types in firmware command requests and responses. o Remove unnecessary conversion to LE when writing registers. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-26drivers/net/netxen: fix sparse warnings: use NULL pointer instead of plain integerHannes Eder1-2/+2
Fix this sparse warnings: drivers/net/netxen/netxen_nic_hw.c:1462:18: warning: Using plain integer as NULL pointer drivers/net/netxen/netxen_nic_hw.c:1536:18: warning: Using plain integer as NULL pointer Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-12netdevice: safe convert to netdev_priv() #part-2Wang Chen1-1/+1
We have some reasons to kill netdev->priv: 1. netdev->priv is equal to netdev_priv(). 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv. But we cann't kill netdev->priv, because so many drivers reference to it directly. This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read. But it is too big to be sent in one mail. I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-14netxen: update driver versionDhananjay Phadke1-4/+4
Raise driver version to 4.0.11. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-14netxen: fix mac addr setupDhananjay Phadke1-13/+38
For NX3031 mac addr should be read from firmware. mac addr in flash is still valid, but can be overridden by firmware if running in virtualization environment. For old revisions, mac addr is retrieved directly from flash. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-07drivers/net/netxen/netxen_nic_hw.c: fix printk warningsAndrew Morton1-2/+4
drivers/net/netxen/netxen_nic_hw.c: In function 'netxen_nic_pci_mem_read_direct': drivers/net/netxen/netxen_nic_hw.c:1414: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'u64' drivers/net/netxen/netxen_nic_hw.c: In function 'netxen_nic_pci_mem_write_direct': drivers/net/netxen/netxen_nic_hw.c:1487: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'u64' You don't know what type was used for u64 hence they cannot be printed without casting. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-07netxen: fix promisc mode, mtu settingDhananjay Phadke1-35/+42
For NX3031, multicast filtering, promisc mode, and max frame size setting is handled by firmware, driver needs to send request to enable/disable it. For old chip revisions / firmware, driver still sets it directly. Added function pointer to set mtu according to chip revision. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-07netxen: add new board typesDhananjay Phadke1-0/+3
Add couple of new board configurations based on NX3031 chip. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-07netxen: fix link status, link speedDhananjay Phadke1-4/+13
For NX3031, the phy is managed by firmware, so driver should avoid setting any phy registers. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22netxen: update driver versionDhananjay Phadke1-9/+5
Change driver version to 4.0.0. Netxen firmwares as old as v3.4.216 are supported. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22netxen: enable tso6, intr coalescing.Dhananjay Phadke1-20/+27
Enable tso6 and ipv6 checksum, interrupt coalescing for NX3031. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22netxen: mtu, mac, link status changesDhananjay Phadke1-15/+183
MAC addr, multicast filters, mtu are set through firmware commands in firmware v4.0.0+ because of virtualization of physical ports. Link status is also read from registers allocated by firmware for each virtual port. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22netxen: add netxen_nic_ctx.cDhananjay Phadke1-243/+0
Contains rx and tx ring context management and certain firmware commands for netxen firmware v4.0.0+. This patch gathers all HW context management code into netxen_nic_ctx.c. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22netxen: pci probe and firmware init changesDhananjay Phadke1-48/+23
Add initialization code in pci probe for new chip and retain compatibility with old revisions. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22netxen: add 2MB PCI memory supportDhananjay Phadke1-115/+1244
New revision of netxen chip has 2MB PCI memory. Older chips had 128MB addressable PCI memory. To retain compatibility, this patch adds function pointers based on pci bar0 size. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22netxen: add defs for new chip/boardsDhananjay Phadke1-38/+27
Add macros for new chip revision and board configurations. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>