summaryrefslogtreecommitdiff
path: root/drivers/staging/vt6656/rxtx.c
AgeCommit message (Collapse)Author
2015-09-29staging: vt6656: don't stop TX queue unless buffer full.Malcolm Priestley
Presently the TX buffer stops while filling the buffer and urb. However, this does not make use of the available buffer space, it also lags the speed of the TX troughtput. Only stop the queue when the buffer becomes full. The URB complete will start the queue again when a buffer and URB is available. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14staging: vt6656: Fixed two lines over 80 characters longArjun Krishna Babu
The presence of comments originally caused the two lines to be over 80 characters long. The issue is fixed by moving the comments into a separate line. Signed-off-by: Arjun Krishna Babu <arjunkrishnababu96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17staging: vt6656: Boolean tests don't need comparisons.Abdul Hussain
This patch remove true and false from boolean tests. Signed-off-by: Abdul Hussain <habdul@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: vt6656: use ieee80211_tx_info to select packet type.Malcolm Priestley
Information for packet type is in ieee80211_tx_info band IEEE80211_BAND_5GHZ for PK_TYPE_11A. IEEE80211_TX_RC_USE_CTS_PROTECT via tx_rate flags selects PK_TYPE_11GB This ensures that the packet is always the right type. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Cc: <stable@vger.kernel.org> # v3.17+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26Staging: vt6656: replace memcpy() by ether_addr_copy() using coccinelle and ↵aybuke ozdemir
pack variable This patch focuses on fixing the following warning generated by checkpatch.pl for the file rxtx.c Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) @@ expression e1, e2; @@ - memcpy(e1, e2, ETH_ALEN); + ether_addr_copy(e1, e2); According to ether_addr_copy() description and functionality, all Ethernet addresses should align to the u16 datatype. The changes were applied using the following coccinelle rule: Here is the output of pahole for the relevant datastructures: struct vnt_usb_send_context { void * priv; /* 0 8*/ struct sk_buff * skb; /* 8 8*/ struct urb * urb; /* 16 8*/ struct ieee80211_hdr * hdr; /* 24 8*/ unsigned int buf_len; /* 32 4*/ u32 frame_len; /* 36 4*/ u16 tx_hdr_size; /* 40 2*/ u16 tx_rate; /* 42 2*/ u8 type; /* 44 1*/ u8 pkt_no; /* 45 1*/ u8 pkt_type; /* 46 1*/ u8 need_ack; /* 47 1*/ u8 fb_option; /* 48 1*/ bool in_use; /* 49 1*/ unsigned char data[2900]; /* 50 2900*/ /* --- cacheline 46 boundary (2944 bytes) was 6 bytes ago --- */ /* size: 2952, cachelines: 47, members: 15 */ /* padding: 2 */ /* last cacheline: 8 bytes */ }; struct ieee80211_key_conf { u32 cipher; /* 0 4*/ u8 icv_len; /* 4 1*/ u8 iv_len; /* 5 1*/ u8 hw_key_idx; /* 6 1*/ u8 flags; /* 7 1*/ s8 keyidx; /* 8 1*/ u8 keylen; /* 9 1*/ u8 key[0]; /* 10 0*/ /* size: 12, cachelines: 1, members: 8 */ /* padding: 2 */ /* last cacheline: 12 bytes */ }; struct vnt_mic_hdr { u8 id; /* 0 1*/ u8 tx_priority; /* 1 1*/ u8 mic_addr2[6]; /* 2 6*/ u8 ccmp_pn[6]; /* 8 6*/ __be16 payload_len; /* 14 2*/ __be16 hlen; /* 16 2*/ __le16 frame_control; /* 18 2*/ u8 addr1[6]; /* 20 6*/ u8 addr2[6]; /* 26 6*/ u8 addr3[6]; /* 32 6*/ __le16 seq_ctrl; /* 38 2*/ u8 addr4[6]; /* 40 6*/ u16 packing; /* 46 2*/ /* size: 48, cachelines: 1, members: 13 */ /* last cacheline: 48 bytes */ }; Signed-off-by: aybuke ozdemir <aybuke.147@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07staging: vt6656: parse cts fall back out of vnt_fill_cts_headMalcolm Priestley
Creating new function vnt_fill_cts_fb_head for the fall back rates. The check for fb_option is now done in vnt_rxtx_cts. This fixes checkpatch warning WARNING: else is not generally useful after a break or return 559: FILE: drivers/staging/vt6656/rxtx.c:559: Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07staging: vt6656: vnt_fill_cts_head remove unneeded NULL check.Malcolm Priestley
union vnt_tx_data_head is nolonger detached from main vnt_tx_buffer structure so this check is unnecessary. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25staging: vt6656: fix Prefer ether_addr_copy() over memcpy() if the Ethernet ↵Heba Aamer
addresses are __aligned(2) This patch fixes the following checkpatch.pl warning: fix Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) Pahole showed that the 2 structs are aligned to u16 struct vnt_mic_hdr { u8 id; /* 0 1 */ u8 tx_priority; /* 1 1 */ u8 mic_addr2[6]; /* 2 6 */ u8 ccmp_pn[6]; /* 8 6 */ __be16 payload_len; /* 14 2 */ __be16 hlen; /* 16 2 */ __le16 frame_control; /* 18 2 */ u8 addr1[6]; /* 20 6 */ u8 addr2[6]; /* 26 6 */ u8 addr3[6]; /* 32 6 */ __le16 seq_ctrl; /* 38 2 */ u8 addr4[6]; /* 40 6 */ u16 packing; /* 46 2 */ /* size: 48, cachelines: 1, members: 13 */ /* last cacheline: 48 bytes */ }; struct ieee80211_hdr { __le16 frame_control; /* 0 2 */ __le16 duration_id; /* 2 2 */ u8 addr1[6]; /* 4 6 */ u8 addr2[6]; /* 10 6 */ u8 addr3[6]; /* 16 6 */ __le16 seq_ctrl; /* 22 2 */ u8 addr4[6]; /* 24 6 */ /* size: 30, cachelines: 1, members: 7 */ /* last cacheline: 30 bytes */ }; Signed-off-by: Heba Aamer <heba93aamer@gmail.com> Reviewed-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12Staging: vt6656: Checkpatch fix: else after break or returnEmrys Bayliss
This patch fixes the following checkpatch.pl error: rxtx.c:588: WARNING: else is not generally useful after a break or return Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12staging: vt6656: whitespace checkpatch warning fix.Krzysztof Adamski
This fixes following checkpatch.pl error: ERROR: space prohibited before that ',' (ctx:WxW) Signed-off-by: Krzysztof Adamski <k@japko.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12staging: vt6656: Use ether_addr_copy() on vnt_private members.Krzysztof Adamski
This patch fixes checkpatch.pl warning: WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) current_net_addr and permanent_net_addr members of vnt_private alignment is changed to at last 16 bits so that ether_addr_copy can be safely used on them. buf->data is of type ieee80211_cts which is already properly aligned. Signed-off-by: Krzysztof Adamski <k@japko.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12staging: vt6656: Use ether_addr_copy() in vnt_fill_ieee80211_rts.Krzysztof Adamski
Both struct ieee80211_rts and struct ieee80211_hdr defined in linux/ieee80211.h are declared as __aligned(2) so it is safe to use ether_addr_copy() instead of memcpy(). Signed-off-by: Krzysztof Adamski <k@japko.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23Staging: vt6656: Merges two lines of code and also removes unused variableMahati Chamarthy
This patch merges an assignment with an immediately following return of the assigned variable. The following Coccinelle semantic patch was used to make this transformation: @@ expression ret; identifier f; @@ -ret = +return f(...); -return ret; A variable that became unused due to this transformation was also removed. Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: vt6656: add blank line after declarationRagnar B. Johannsson
Adds a blank line after declaration to comply with coding style. Signed-off-by: Ragnar B. Johannsson <ragnar@igo.is> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: vt6656: fix incorrect indentationRagnar B. Johannsson
Use tabs, not spaces. Signed-off-by: Ragnar B. Johannsson <ragnar@igo.is> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22staging: vt6656: struct vnt_tx_short_buf_head change base type of fifo_ctl ↵Malcolm Priestley
to __le16 Base type is always little endian. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22staging: vt6656: struct vnt_tx_fifo_head fifo_ctl change base type to __le16Malcolm Priestley
Endian is always little add correction in vnt_tx_packet. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22staging: vt6656: struct vnt_beacon_buffer replace byType with typeMalcolm Priestley
Removing camel case Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22staging: vt6656: vnt_tx_buffer replace byType with typeMalcolm Priestley
Removing camel case Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22staging: vt6656: struct vnt_beacon_buffer replace byPKTNO with pkt_noMalcolm Priestley
removing camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22staging: vt6656: struct vnt_tx_buffer replace byPKTNO with pkt_noMalcolm Priestley
Replacing camel case Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22staging: vt6656: vnt_tx_fifo_head rename wFIFOCtl to fifo_ctlMalcolm Priestley
Removing prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_usb_send_context context into vnt_get_duration_leMalcolm Priestley
Removing priv, frame_length and need_ack Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging; vt6656: rxtx add current_rate into vnt_usb_send_context as tx_rateMalcolm Priestley
Create u8 tx_rate and remove current_rate from function declarations Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: rxtx move frame_len/size into vnt_usb_send_context as frame_lenMalcolm Priestley
Removing frame_len and frame_size from function declarations Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: move need_ack into into vnt_usb_send_contextMalcolm Priestley
Fixing need_ack to u8 and removing from function declarations. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: rxtx move pkt_type into vnt_usb_send_contextMalcolm Priestley
Removing pkt_type from functions Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: vnt_get_duration_le fix typo piv to privMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private replace byAutoFBCtrl with auto_fb_ctrlMalcolm Priestley
Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private replace wSeqCounter with seq_counterMalcolm Priestley
Removing type prefix and camel case Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private replace wCurrentRate with current_rateMalcolm Priestley
Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private replace byPreambleType with preamble_typeMalcolm Priestley
Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private replace byTopCCKBasicRate with ↵Malcolm Priestley
top_cck_basic_rate Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private replace byTopOFDMBasicRate with ↵Malcolm Priestley
top_ofdm_basic_rate Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private replace byPacketType with packet_typeMalcolm Priestley
Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private replace byBBType with bb_typeMalcolm Priestley
Removing type prefix and camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private remove camel case IFS namesMalcolm Priestley
Camel case changes uSIFS -> sifs uDIFS -> difs uEIFS -> eifs uSlot -> slot Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: remame abyCurrentNetAddr to current_net_addrMalcolm Priestley
Removing prefix and camel case Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21staging: vt6656: struct vnt_private rename cdTD to num_tx_contextMalcolm Priestley
number of tx_context Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-18staging: vt6656: struct vnt_private rename apTD to tx_contextMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-15staging: vt6656: rename PIPEnsSendBulkOut to vnt_tx_context.Malcolm Priestley
We are just tx the context Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-13staging: vt6656: Drop u8 pointer and rename bScheduleCommand.Malcolm Priestley
Rename to vnt_schedule_command removing unused u8 pointer. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: vt6656: rxtx replace debug messages DBG_PRTMalcolm Priestley
Replace with dev_dbg Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: vt6656: rxtx remove unneeded commentsMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: vt6656: rxtx remove static declarationsMalcolm Priestley
all functions are in visibility order. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: vt6656: rename s_vGetFreeContext to vnt_get_free_contextMalcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: vt6656: clean up and rename wFB_Opt1 to vnt_fb_opt1Malcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: vt6656: clean up and rename wFB_Opt0 to vnt_fb_opt0Malcolm Priestley
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: vt6656: rename and cleanup wTimeStampOffMalcolm Priestley
Rename to vnt_time_stampoff Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-11staging: vt6656: rename s_uGetTxRsvTime to vnt_get_rsvtimeMalcolm Priestley
Drop tx from name Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>