aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_hw.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
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>
2008-07-22netxen: hw multicast filteringDhananjay Phadke1-9/+124
Enable multicast address filtering capabilities in the hardware. Upto 16 multicast addresses can be programmed for each physical port. Support "allmulti" mode, if enabled. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22netxen: cleanup unused variables/functionsDhananjay Phadke1-208/+62
o Reduce access to global arrays in data path. o Remove duplicate/unused variables, unecessary alignment constraints. o Use correct pci_dev instead of fallback device for consistent allocations. o Disable ethtool set_eeprom functionality for now, it was only used for flashing firmware. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-06-17netxen: cleanup debug messagesDhananjay Phadke1-60/+44
o Remove unnecessary debug prints and functions. o Explicitly specify pci class (0x020000) to avoid enabling management function. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-06-17netxen: remove global physical_port arrayDhananjay Phadke1-4/+4
Store physical port number in netxen_adapter structure. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-25netxen: reduce stack usage of netxen_nic_flash_printHarvey Harrison1-7/+8
Don't need to keep a struct netxen_new_user_info on the stack when we only are interested in printing the serial_num. Change to only reading the serial_num. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-03-25netxen: improve msi supportDhananjay Phadke1-0/+2
Recent netxen firmware has new scheme of generating MSI interrupts, it raises interrupt and blocks itself, waiting for driver to unmask. This reduces chance of spurious interrupts. The driver will be able to deal with older firmware as well. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Tested-by: Vernon Mauery <mauery@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28annotate netxenAl Viro1-13/+13
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28[netdrvr] netxen: checkpatch fixes (98% trim trailing whitespace)Jeff Garzik1-6/+6
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-01-28drivers/net/netxen: Add missing "space"Joe Perches1-1/+1
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28drivers/net/netxen/: cleanupsAdrian Bunk1-8/+11
This patch contains the following cleanups: - static functions in .c files shouldn't be marked inline - make needlessly global code static - #if 0 unused code Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10drivers/net/: all drivers/net/ cleanup with ARRAY_SIZEDenis Cheng1-1/+1
Signed-off-by: Denis Cheng <crquan@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-08-31netxen: fix crashes during module unloaddhananjay@netxen.com1-4/+4
This patch fixes two problems during driver unload. The pci_disable_device() call is before firmware reload, causing reads and writes across PCI bus after disabling device. Second problem is the register window was wrong during firmware reload Signed-off by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-02RESEND [PATCH 3/3] NetXen: Graceful teardown of interface and hardware upon module unloadDhananjay Phadke1-10/+19
Resending patch 3/3 only. These changes allow driver close routine to be called during module unload, to clean-up buffers and other software resources, flush queues etc. Also, hardware is reset to pristine state. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: Milan Bag <mbag@netxen.com> Signed-off-by: Wen Xiong <wenxiong@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-02RESEND [PATCH 2/3] NetXen: Support per PCI-function interrupt mask registersdhananjay.phadke@gmail.com1-1/+5
This patch updates the various access routines to access different control and status settings present in different register locations. This will fix problems related to working of different ports in multi Port card. Signed-off by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off by: Milan Bag <mbag@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-06-09NetXen: Fix compile failure seen on PPC architectureMithlesh Thukral1-6/+6
NetXen: Add NETXEN prefixes to macros to clean them up. This is a cleanup patch which adds NETXEN prefix to some stand alone macro names. These posed compile errors when NetXen driver was backported to 2.6.9 on PPC architecture as macros like USER_START are defined in file arch/ppc64/mm/hash_utils.c Signed-off-by: Andy Gospodarek <andy@greyhouse.net> Signed-off by: Wen Xiong <wenxiong@us.ibm.com> Acked-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28NetXen: Fixes for Power PC architectureMithlesh Thukral1-2/+1
NetXen: Fix PPC architecture specific bugs Fixes some issues seen on Big endian machines. Signed-off by: Milan Bag <mbag@netxen.com> Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28NetXen: Port swap feature for multi port cardsMithlesh Thukral1-54/+13
NetXen: Port Swap feature This patch will allow a port numbers on the card to be swapped in host driver. This feature is applicable to cards having more than 1 port. Signed-off by: Milan Bag <mbag@netxen.com> Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28NetXen: Multi PCI support for Quad cardsMithlesh Thukral1-7/+108
NetXen: Fix the multi PCI function for cards with more than 2 ports. This patch fixes the working of multi PCI capable driver on cards with more than 2 ports by adding the addresses for their rings and sizes. Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28NetXen: Removal of redundant argument passingMithlesh Thukral1-4/+15
NetXen: Removal of redundant function call parameters and bug fixes. This patch will remove the redundant paramters which were being passed to many functions since now adapter->portnum can be used. Signed-off-by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28NetXen: Use multiple PCI functionsMithlesh Thukral1-53/+168
NetXen: Make driver use multiple PCI functions. This patch will make NetXen driver work with multiple PCI functions. This will make the usage of memory resources as well as interrupts more independent among different functions which results in better throughput. This change has been done after the multiport support is added in firmware. Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-25[TCP]: Introduce tcp_hdrlen() and tcp_optlen()Arnaldo Carvalho de Melo1-2/+1
The ip_hdrlen() buddy, created to reduce the number of skb->h.th-> uses and to avoid the longer, open coded equivalent. Ditched a no-op in bnx2 in the process. I wonder if we should have a BUG_ON(skb->h.th->doff < 5) in tcp_optlen()... Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25[SK_BUFF]: Introduce skb_transport_offset()Arnaldo Carvalho de Melo1-1/+1
For the quite common 'skb->h.raw - skb->data' sequence. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iphArnaldo Carvalho de Melo1-2/+2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25[IP]: Introduce ip_hdrlen()Arnaldo Carvalho de Melo1-3/+5
For the common sequence "skb->nh.iph->ihl * 4", removing a good number of open coded skb->nh.iph uses, now to go after the rest... Just out of curiosity, here are the idioms found to get the same result: skb->nh.iph->ihl << 2 skb->nh.iph->ihl<<2 skb->nh.iph->ihl * 4 skb->nh.iph->ihl*4 (skb->nh.iph)->ihl * sizeof(u32) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25[SK_BUFF]: Introduce skb_network_offset()Arnaldo Carvalho de Melo1-1/+1
For the quite common 'skb->nh.raw - skb->data' sequence. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-03-15NetXen: Bug fix for Jumbo frames on XG cardLinsys Contractor Mithlesh Thukral1-1/+4
NetXen: Set the MTU for the right port depending upon the port number for XG cards. Signed-off by: Mithlesh Thukral <mithlesh@netxen.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-09netxen: fix warningsRalf Baechle1-2/+3
CC [M] drivers/net/netxen/netxen_nic_hw.o drivers/net/netxen/netxen_nic_hw.c: In function 'netxen_nic_hw_resources': drivers/net/netxen/netxen_nic_hw.c:231: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'dma_addr_t' drivers/net/netxen/netxen_nic_hw.c:250: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'dma_addr_t' u64 is unsigned long so the cast to u64 will result in a warning on the printf arguments for 64-bit builds. So cast to unsigned long long instead. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>