summaryrefslogtreecommitdiff
path: root/drivers/staging/et131x
AgeCommit message (Collapse)Author
2014-10-03staging: et131x: Remove et131x driver from drivers/stagingMark Einon
The current version of the et131x driver has been accepted into the main tree at /drivers/net/ethernet, so it can now be removed from staging. The MAINTAINERS entry has not been touched here, as the patch to add the driver to drivers/net modifies it correctly. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-29staging: et131x: Simplify for loop in et131x_init_send()Mark Einon
The for loop in this function increments two variables and has an unusual starting index of 1 (not 0). Make it look more familiar. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-29staging: et131x: Audit and update commentsMark Einon
Many of the functions and variables in the driver have been renamed and are now more understandable, as well as defines added for various constants. Update / remove some comments to reflect this. Also many comments were unnecessary dialogue describing what is evident from the code, or comments were just plain incorrect. Remove these too. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28staging: et131x: Remove unnecessary parenthesesMark Einon
Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28staging: et131x: Remove unnecessary OOM messageMark Einon
Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28staging: et131x: Cat some lines less than 80 columnsMark Einon
Some split lines are less than 80 chars if rejoined, so rejoin them. Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28staging: et131x: Use ether_addr_copy when copying ethernet addressesMark Einon
Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Remove unnecessary defines to enable driver PMMark Einon
The Power Management functions can be conditional by assigning pm ops directly to .driver.pm, instead of using #ifdef's, saving some lines of code. Reported-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Add space after { in pci ID tableMark Einon
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: don't cast a void* to a struct pointerMark Einon
Casting a void* popinter to a struct pointer is unnecessary, don't do it. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: zero allocation of fbr to prevent random address accessMark Einon
If et131x_rx_dma_memory_alloc() allocates rx_ring->fbr[0] but fails to allocate rx_ring->fbr[1], this leaves fbr[0]->ring_virtaddr with the possibility of being accessed in et131x_rx_dma_memory_free() as it contains a random value, potentially causing an oops. Fix this by zeroing the fbr memory on allocation. Subsequent frees of this fbr memory explicitly zeros the ring_virtaddr value. Reported-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Remove TODO item regarding split linesMark Einon
Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Reduce split lines by renaming flowcontrolMark Einon
Rename adapter->flowcontrol to adapter->flow, reducing split lines. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Use braces on all arms of if/else in et131x_handle_recv_pktsMark Einon
The 'if' blocks have braces, so the 'else' blocks should too. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Reduce split lines by renaming some psr variablesMark Einon
Modify some packet status ring associated variables to save a few split lines: pktstat_ringsize -> psr_size psr_num_entries -> psr_entries index -> ii Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Reduce split lines in et131x_rx_dma_memory_alloc()Mark Einon
Modify temporary variables so that split lines can be reduced: index -> k fbr_tmp_physaddr -> fbr_physaddr Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Remove unused ce_stats struct memberMark Einon
This ce_stats struct member is no longer used. Remove it. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Remove unused MP_TCB definesMark Einon
These two defines are not used, so remove them. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23staging: et131x: Remove unused et131x_adapter struct membersMark Einon
These two adapter struct members are not used, remove them. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: logical continuations should be on the previous lineMark Einon
Fix two occurrences of the checkpatch check: CHECK: Logical continuations should be on the previous line Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Fix 'else is not generally useful after a break or return'Mark Einon
Fix this checkpatch warning: WARNING: else is not generally useful after a break or return Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Use variable names instead of types in sizeofMark Einon
A few calls to sizeof() in et131x.c give the type as a parameter - use the equivalent variable name instead. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Use braces on all arms of if/else statementsMark Einon
In some places in et131x.c, one arm of am if/else statement has braces and the other not - put braces on both arms where this happens. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Remove spaces after castsMark Einon
In three places in et131x.c, spaces exist after a cast. Remove them. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Add spinlock definition commentsMark Einon
Checkpatch --strict advises that spinlocks should be described when defined, seems a good idea so this change does that. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Remove useless assignment to NULLMark Einon
The stack variable skb is no longer used after it's set to NULL. Don't set it to NULL. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Remove send_hw_lock spinlockMark Einon
We don't need to use this lock - the tx path is protected by the networking subsystem xmit_lock, so we don't also need it in nic_send_packet(). The other use of this spinlock in et1310_enable_phy_coma() to protect a low power flag makes no sense, so can just be removed. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Simplify unlocking tcb_send_qlock in et131x_tx_timeout()Mark Einon
The tcb_send_qlock spinlock is unlocked in all three paths at the end of et131x_tx_timeout(). We can call it once before entering any of the paths, saving ourselves a few lines of code. This change puts tcb->count++ outside of the lock, but et131x_tx_timeout() itself is protected by the tx_global_lock, so this shouldn't matter. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Remove blank lines form et131x.cMark Einon
Remove some unecessary blank lines from et131x.c Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Remove extra blank lines in et131x.hMark Einon
Remove some blank lines from et131.h, including double blank lines. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Remove 'reduce number of spinlocks' TODO itemMark Einon
The number of spinlocks has been halved, from 8 to 4 since this comment was made, let's see if this is enough. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Simplify code in nic_rx_pkts() for multicast_pkts_rcvdMark Einon
In nic_rx_pkts(), we check that a multicast packet received (when using a multicast list) is one that was requested - despite setting the list up with the hardware. We shouldn't expect to get a mc packet we didn't ask for, so remove these extra checks. This also means that the surrounding code can be tiedied up a little. Tested somewhat with omping, with no adverse effects seen. Also remove this item from the TODO list. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Combine two if statements with same effectMark Einon
Both these if statements have the same effect when true, so combine them and save a few lines. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Remove struct tcb->flagsMark Einon
'struct tcb' member 'flags' was only used to collect tx stats, now we are no longer collecting those particular stats, we no longer need tcb->flags or the code used to peek into the skb to set it's value. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Remove ununsed statisticsMark Einon
From struct ce_stats; unicast_pkts_rcvd, unicast_pkts_xmtd, multicast_pkts_xmtd, broadcast_pkts_rcvd and broadcast_pkts_xmtd are not returned or used for anything meaningful - remove the code that collects them, and the struct members too. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Tidy up rx/tx dropped & bytes statsMark Einon
Remove some fairly useless comments regarding rx/tx _bytes and _dropped, and use rcvd_pkts_dropped stat value to provide rx_dropped. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: In et131x_tx(), don't return NETDEV_TX_BUSY, just drop the ↵Mark Einon
packet Memory allocation errors do not denote NETDEV_TX_BUSY, simply drop the packet silently with kfree_skb() and return NETDEV_TX_OK. Also remove this item from the TODO list. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19staging: et131x: Remove et131x_send_packets() functionMark Einon
Remove et131x_send_packets() and replace the only use in et131x_tx with the removed function's body. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08staging: et131x: Fix whitespace - alignment matching open parenthesisMark Einon
Fix occurrences in et131x.c of: CHECK: Alignment should match open parenthesis Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08staging: et131x: Add auto-negotiation and 1000BT_Half as supported protocolsMark Einon
The driver supports auto-negotiation and 100BaetT_Half but doesn't advertise or list it in it's phydev. Fix that. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08staging: et131x: Remove spinlock fbr_lockMark Einon
The spinlock fbr_lock is only used in a single call sequence staring from et131x_poll. As this call is already locked by napi->poll_lock, we can remove it. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08staging: et131x: Remove dead code in isrMark Einon
Dan Carpenter reports: The patch c2ebf58ba089: "staging: et131x: Implement NAPI support" from Aug 21, 2014, leads to the following static checker warning: drivers/staging/et131x/et131x.c:4004 et131x_isr() warn: we tested 'status' before and it was 'true' We don't actually need the dead code, as we're now using NAPI to handle enabling interrupts - but we do need to enable interrupts if NAPI is not scheduled - so enable interrupts if this is the case. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-02staging: et131x: et131x.c: sparse warning of incompatible typesSudip Mukherjee
fixed sparse warning: incompatible types in comparison expression (different address spaces) wolw and reg both are being used only for the initialization of the __iomem area. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-31Merge 3.17-rc3 into staging-nextGreg Kroah-Hartman
We want the staging bugfixes in this branch as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: et131x: Implement NAPI supportMark Einon
This implements NAPI support for et131x by: -adding a napi_struct to the private adapter struct -changing netfif_rx_skb() call to netif_receive_skb() -changing et131x_handle_recv_interrupt() to et131x_handle_recv_pkts() and taking a budget allocation. -changing et131x_handle_send_interrupt() to et131x_handle_send_pkts() -replacing bottom half workqueue with poll function which handles send & receive of skbs. -adding various other necessary standard napi calls. Also remove this item from the README TODO list. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: et131x: Fix ET_INTR_TXDMA_ISR register name typoMark Einon
We actually mean to clear the ET_INTR_TXDMA_ISR reg after handling a completed transfer, not the ET_INTR_TXDMA_ERR reg, which should get handled immediately after. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: et131x: Rename NUM_PACKETS_HANDLED to MAX_PACKETS_HANDLEDMark Einon
To better describe it's use as a hard limit. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: et131x: Remove unnecessary i2c_wack variableMark Einon
i2c_wack is only used to implement a while(1) loop, so let's remove it. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: et131x: Use for loop to initialise contiguous macstat registers to zeroMark Einon
Replace a long list of contiguous writel() calls with a for loop iterating over the same address values. Also remove redundant comments on the macstat registers, the variable names are good enough. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30staging: et131x: Use for loop to initialise contiguous registers to zeroMark Einon
Replace a long list of contiguous writel() calls with a for loop iterating over the same values. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>