aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/brocade (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-09-27bna: Fix warning false positive.David S. Miller1-0/+1
GCC can't see that in all non-error-return paths we do in fact set *using_dac to something. Add an explicit initialization to remove this warning: drivers/net/ethernet/brocade/bna/bnad.c: In function ‘bnad_pci_probe’: drivers/net/ethernet/brocade/bna/bnad.c:3079:5: warning: ‘using_dac’ may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/net/ethernet/brocade/bna/bnad.c:3233:7: note: ‘using_dac’ was declared here Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-10drivers/net/ethernet: Fix non-kernel-doc comments with kernel-doc start markersBen Hutchings21-821/+310
Convert doxygen (or similar) formatted comments to kernel-doc or unformatted comment. Delete a few that are content-free. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-10drivers/net/ethernet: Fix (nearly-)kernel-doc comments for various functionsBen Hutchings1-28/+8
Fix incorrect start markers, wrapped summary lines, missing section breaks, incorrect separators, and some name mismatches. Delete a few that are content-free. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-06ethernet: Remove casts to same typeJoe Perches1-2/+2
Adding casts of objects to the same type is unnecessary and confusing for a human reader. For example, this cast: int y; int *p = (int *)&y; I used the coccinelle script below to find and remove these unnecessary casts. I manually removed the conversions this script produces of casts with __force, __iomem and __user. @@ type T; T *p; @@ - (T *)p + p A function in atl1e_main.c was passed a const pointer when it actually modified elements of the structure. Change the argument to a non-const pointer. A function in stmmac needed a __force to avoid a sparse warning. Added it. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-22Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds1-3/+1
Pull trivial updates from Jiri Kosina: "As usual, it's mostly typo fixes, redundant code elimination and some documentation updates." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (57 commits) edac, mips: don't change code that has been removed in edac/mips tree xtensa: Change mail addresses of Hannes Weiner and Oskar Schirmer lib: Change mail address of Oskar Schirmer net: Change mail address of Oskar Schirmer arm/m68k: Change mail address of Sebastian Hess i2c: Change mail address of Oskar Schirmer net: Fix tcp_build_and_update_options comment in struct tcp_sock atomic64_32.h: fix parameter naming mismatch Kconfig: replace "--- help ---" with "---help---" c2port: fix bogus Kconfig "default no" edac: Fix spelling errors. qla1280: Remove redundant NULL check before release_firmware() call remoteproc: remove redundant NULL check before release_firmware() qla2xxx: Remove redundant NULL check before release_firmware() call. aic94xx: Get rid of redundant NULL check before release_firmware() call tehuti: delete redundant NULL check before release_firmware() qlogic: get rid of a redundant test for NULL before call to release_firmware() bna: remove redundant NULL test before release_firmware() tg3: remove redundant NULL test before release_firmware() call typhoon: get rid of redundant conditional before all to release_firmware() ...
2012-04-30bna: remove redundant NULL test before release_firmware()Jesper Juhl1-3/+1
release_firmware() does its own NULL test so explicit test before call is unneeded. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2012-04-04bna: Update driver version to 3.0.23.0Jing Huang1-1/+1
Driver version update Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04bna: Function name changes and cleanupsJing Huang3-32/+32
Renamed following functions: bnad_cleanup_tx to bnad_destroy_tx bnad_free_all_txbufs to bnad_txq_cleanup bnad_free_txbufs to bnad_txcmpl_process bnad_tx to bnad_tx_complete bnad_cleanup_rx to bnad_destroy_rx bnad_reset_rcb to bnad_rcb_cleanup bnad_free_all_rxbufs to bnad_rxq_cleanup bnad_cq_cmpl_init to bnad_cq_cleanup bnad_alloc_n_post_rxbufs to bnad_rxq_post bnad_poll_cq to bnad_cq_process Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04bna: Remove tx taskletJing Huang2-71/+3
The scheduling of tasklet and keeping the interrupts enabled makes interrupt reduntant. 20% of the Tx interrupts have nothing left to process or could not process as Tx tasklet was running. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04bna: tx rx cleanup fixJing Huang2-80/+125
This patch removes busy wait in tx/rx cleanup. bnad_cb_tx_cleanup() and bnad_cb_rx_cleanup() functions are called from irq context, and currently they do busy wait for the in-flight transmit or the currently executing napi polling routine to complete. To fix the issue, we create a workqueue to defer tx & rx cleanup processing, an in the tx rx cleanup handler, we will wait respective in flight processing to complete, before freeing the buffers. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04bna: ioc cleanupsJing Huang1-10/+1
Remove irrelevant code. Change to start Hearbeat failure moniter after IOC become operational. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04bna: Flash controller ioc pll init fixesJing Huang2-46/+102
Added NFC pause/resume logic. We only do NFC pause/resume if NFC version is greater than 0x143 and it was halted before, otherwise we revert to old NFC halt mechanism. Made changes to avoid clearing off the interrupts during the initial pll initialization. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-04-04bna: Serialize smem access during adapter initializationJing Huang1-8/+42
Use init semaphore to serialize execution of the "unlock IOC semaphore" code. Added bfa_ioc_fwver_clear() function to clear the firmware header if last firmwar boot is not from driver. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-21Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfsLinus Torvalds1-1/+1
Pull vfs pile 1 from Al Viro: "This is _not_ all; in particular, Miklos' and Jan's stuff is not there yet." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (64 commits) ext4: initialization of ext4_li_mtx needs to be done earlier debugfs-related mode_t whack-a-mole hfsplus: add an ioctl to bless files hfsplus: change finder_info to u32 hfsplus: initialise userflags qnx4: new helper - try_extent() qnx4: get rid of qnx4_bread/qnx4_getblk take removal of PF_FORKNOEXEC to flush_old_exec() trim includes in inode.c um: uml_dup_mmap() relies on ->mmap_sem being held, but activate_mm() doesn't hold it um: embed ->stub_pages[] into mmu_context gadgetfs: list_for_each_safe() misuse ocfs2: fix leaks on failure exits in module_init ecryptfs: make register_filesystem() the last potential failure exit ntfs: forgets to unregister sysctls on register_filesystem() failure logfs: missing cleanup on register_filesystem() failure jfs: mising cleanup on register_filesystem() failure make configfs_pin_fs() return root dentry on success configfs: configfs_create_dir() has parent dentry in dentry->d_parent configfs: sanitize configfs_create() ...
2012-03-20debugfs-related mode_t whack-a-moleAl Viro1-1/+1
all of those should be umode_t... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-02-13drivers/net: Remove boolean comparisons to true/falseJoe Perches2-5/+5
Booleans should not be compared to true or false but be directly tested or tested with !. Done via cocci script: @@ bool t; @@ - t == true + t @@ bool t; @@ - t != true + !t @@ bool t; @@ - t == false + !t @@ bool t; @@ - t != false + t Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-10Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-6/+4
Conflicts: drivers/infiniband/hw/nes/nes_cm.c Simple whitespace conflict. Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-09bna: fix error handling of bnad_get_flash_partition_by_offset()Dan Carpenter1-6/+4
The current error handling doesn't work because we flash_part is a u32 so the checks for negative error codes don't work. I considered making things signed but I don't know the hardware enough to say if that's a problem. Really, we don't use the error codes so just returning zero for all problems is fine. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-01bna: Implement ethtool flash_device entry point.Krishna Gudipati2-0/+43
Incorporated review comments from Ben Hutchings. Change details: - Implement ethtool flash_device() entry point to write the firmware image to the flash firmware partition. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-31drivers/net: Remove alloc_etherdev error messagesJoe Perches1-1/+0
alloc_etherdev has a generic OOM/unable to alloc message. Remove the duplicative messages after alloc_etherdev calls. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-31drivers/net: Remove unnecessary k.alloc/v.alloc OOM messagesJoe Perches1-18/+3
alloc failures use dump_stack so emitting an additional out-of-memory message is an unnecessary duplication. Remove the allocation failure messages. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-05bna: fix sparse warnings/errorsstephen hemminger4-7/+8
This fixes a several sparse warnings. * the __iomem tag was being used incorrectly (needs to be a prefix) * several variables should have been static since local to one file * the firmware was not being forwared declared and was const one place and not the other Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-05bna: make ethtool_ops and strings conststephen hemminger1-2/+2
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-23bna: Add debugfs interface.Krishna Gudipati10-4/+827
Change details: - Add debugfs support to obtain firmware trace, saved firmware trace on an IOC crash, driver info and read/write to registers. - debugfs hierarchy: bna/pci_dev:<pci_name> where the pci_name corresponds to the one under /sys/bus/pci/drivers/bna - Following are the new debugfs entries added: fwtrc: collect current firmware trace. fwsave: collect last saved fw trace as a result of firmware crash. regwr: write one word to chip register regrd: read one or more words from chip register. drvinfo: collect the driver information. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-23bna: Added flash sub-module and ethtool eeprom entry points.Krishna Gudipati9-39/+771
Change details: - The patch adds flash sub-module to the bna driver. - Added ethtool set_eeprom() and get_eeprom() entry points to support flash partition read/write operations. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-19net: fix assignment of 0/1 to bool variables.Rusty Russell1-3/+3
DaveM said: Please, this kind of stuff rots forever and not using bool properly drives me crazy. Joe Perches <joe@perches.com> gave me the spatch script: @@ bool b; @@ -b = 0 +b = false @@ bool b; @@ -b = 1 +b = true I merely installed coccinelle, read the documentation and took credit. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-08net: make vlan ndo_vlan_rx_[add/kill]_vid return error valueJiri Pirko1-4/+8
Let caller know the result of adding/removing vlan id to/from vlan filter. In some drivers I make those functions to just return 0. But in those where there is able to see if hw setup went correctly, return value is set appropriately. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-16bna: Convert MAC_ADDRLEN uses to ETH_ALENJoe Perches1-2/+1
Reduce the number of #defines, use the normal #define from if_ether.h Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-11-08sweep the floors and convert some .get_drvinfo routines to strlcpyRick Jones1-5/+6
Per the mention made by Ben Hutchings that strlcpy is now the preferred string copy routine for a .get_drvinfo routine, do a bit of floor sweeping and convert some of the as-yet unconverted ethernet drivers to it. Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-31drivers/net: Add module.h to drivers who were implicitly using itPaul Gortmaker1-0/+1
The device.h header was including module.h, making it present for most of these drivers. But we want to clean that up. Call out the include of module.h in the modular network drivers. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-19net: add skb frag size accessorsEric Dumazet1-3/+3
To ease skb->truesize sanitization, its better to be able to localize all references to skb frags size. Define accessors : skb_frag_size() to fetch frag size, and skb_frag_size_{set|add|sub}() to manipulate it. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-07net: Remove unnecessary driver assignments of ethtool_ringparam fields to zeroRick Jones1-4/+0
Per comments from Ben Hutchings on a previous patch, sweep the floors a little removing unnecessary assignments of zero to fields of struct ethtool_ringparam in driver code supporting ethtool -g. Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-04bna: Multiple Definition and Interface Setup FixRasesh Mody3-3/+6
drivers/net/built-in.o: In function `bfa_ioc_ct2_poweron': (.text+0xcdc90): multiple definition of `bfa_ioc_ct2_poweron' drivers/scsi/built-in.o:(.text+0x17f9a0): first defined here This patch renames bfa_ioc_ct2_poweron() to bfa_nw_ioc_ct2_poweron() to avoid multiple definition with Brocade scsi driver. It also modifies asic specific interface setup to allocate MSIX resources at power on in case of 1860 HW with no asic block and warns if the asic gen is neither BFI_ASIC_GEN_CT nor BFI_ASIC_GEN_CT2. Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-29bna: Driver Version changed to 3.0.2.2Rasesh Mody1-1/+1
Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-29bna: Add Callback to Fix RXQ StopRasesh Mody4-1/+38
Change details: - Add a callback in the BNA, which is called before sending FW command to stop RxQs. After this callback is called, driver should not post anymore Rx buffers to the RxQ. This addresses a small window where driver posts Rx buffers while FW is stopping/has stopped the RxQ. - Registering callback function, rx_stall_cbfn, during bna_rx_create. Invoking callback function, rx_stall_cbfn, before sending rx_cfg_clr command to FW - Bnad_cb_rx_stall implementation - set a flag in the Rxq to mark buffer posting disabled state. While posting buffers check for the above flag. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-29bna: PLL Init Fix and Add Stats AttributesRasesh Mody5-33/+33
Change details: - Fix to release soft reset in PLL init for HW - Added stats attributes and new bfi msg class - Removed some unused code and typo fixes Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-29bna: Brocade 1860 HW EnablementRasesh Mody5-2/+51
This patch enables new HW Brocade 1860. Add BFA_CM_NIC capability mask to bfa_ioc_attr, Sub-System Device ID Info and support for Brocade 1860 device ID to bfa_ioc.c and bnad.c. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-29bna: Implement FW Download for New HWRasesh Mody5-10/+48
Add new device ID 0x22 and new asic generation BFI_ASIC_GEN_CT2 for 1860. Implement FW download from user space for new Brocade HW. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-29bna: Capability Map and MFG Block Changes for New HWRasesh Mody2-38/+18
Add capability map and generic model name scheme for manufacturing block. Add card types for new HW. Remove bfa_mfg_is_card_type_valid and ibfa_mfg_adapter_prop_init_flash_ct macros. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-29bna: Brocade 1860 IOC PLL, Reg Defs and ASIC Mode ChangesRasesh Mody3-16/+394
Add logic to set ASIC specfic interface in IOC, HW interface initialization APIs, mode based initialization and MSI-X resource allocation for 1860 with no asic block. Add new h/w specific register definitions and setup registers used by IOC logic. Use normal kernel declaration style, c99 initializers and const for mailbox structures. Remove unneeded parentheses. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-21bna: PCI Probe Conf Lock FixRasesh Mody1-0/+1
If register_netdev() fails now, then we call mutex_unlock(&bnad->conf_mutex); on the error path, but it's already unlocked. So we acquire the lock in error path which will be later unlocked after the cleanup. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-17bna: Eliminate Small Race Condition Window in RX PathRasesh Mody1-2/+3
Change details: - In a continuous sequence of ifconfig up/down operations, there is a small window of race between bnad_set_rx_mode() and bnad_cleanup_rx() while the former tries to access rx_info->rx & the latter sets it to NULL. This race could lead to bna_rx_mode_set() being called with a NULL (rx_info->rx) pointer and a crash. - Hold bnad->bna_lock while setting / unsetting rx_info->rx in bnad_setup_rx() & bnad_cleanup_rx(), thereby eliminating the race described above. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-17bna: Set Ring Param FixRasesh Mody1-2/+3
When Rx queue size is changed, queues are torn down and setup with the new queue size. During this operation, clear promiscuous mode and restore the original VLAN filter. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-17bna: Semaphore Lock FixRasesh Mody1-1/+1
Remove a BUG_ON() as it is not required. Change the unconditional write to release a semaphore to read sem first and then write. This will eliminate the possibility of sem getting locked while trying to release it in case if previous sem_get operation failed. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-16bna: make function tables contstephen hemminger5-43/+36
To prevent malicious usage, all tables of pointers must be const. Compile tested only. Gleaned for PAX. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-16Merge branch 'master' of ../netdev-next/David S. Miller1-2/+2
2011-09-15bna: Driver Version changed to 3.0.2.1Rasesh Mody1-1/+1
Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15bna: SKB PCI UNMAP FixRasesh Mody1-27/+8
Change details: - Found a leak in sk_buff unmapping of PCI dma addresses where boundary conditions are not properly handled in freeing all Tx buffers. Freeing of all Tx buffers is done considering sk_buffs data and fragments can be mapped at the boundary. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15bna: TX Queue Depth FixRasesh Mody2-4/+8
sk_buff unmap_array grows greater than 65536 (x2) with Tx ring of 65536. Reducing TXQ depth and safe(max) acking of Tx events to 32768 (same as Rx). Add defines for TX and RX queue depths. Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-09-15bna: MBOX IRQ Flag Check after LockingRasesh Mody1-7/+11
Change details: - Check the BNAD_RF_MBOX_IRQ_DISABLED flag after acquiring the bna_lock, since checking the flag and executing bna_mbox_handler needs to be atomic. If not, it opens up window where flag is reset when it was checked, but got set while spinning on the lock by the other thread which is actually holding the lock Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>