* Re: linux-next: Tree for Aug 7
From: Eric Dumazet @ 2013-08-07 16:17 UTC (permalink / raw)
To: Johannes Berg
Cc: Phil Sutter, Sedat Dilek, Stephen Rothwell, linux-next,
linux-kernel, netdev, David Miller, Hannes Frederic Sowa,
wireless, John Linville
In-Reply-To: <1375891974.8154.1.camel@jlt4.sipsolutions.net>
On Wed, 2013-08-07 at 18:12 +0200, Johannes Berg wrote:
> On Wed, 2013-08-07 at 17:59 +0200, Phil Sutter wrote:
>
> > The idea behind this patch is that users setting the protocol to
> > something else probably do know better and so should be left alone.
>
> Regardless of that, I think that still the skb pointers would be changed
> by this patch which would confuse the receiver of the SKB (device
> driver), no? Has anyone verified that theory? :)
Maybe receivers made wrong assumptions about some headers being set or
not set ?
A patch can uncover prior bugs.
commit 76fe45812a3b134c3917 is an example of a fix we had to do because
of another fix ;)
^ permalink raw reply
* Re: linux-next: Tree for Aug 7
From: Johannes Berg @ 2013-08-07 16:22 UTC (permalink / raw)
To: Eric Dumazet
Cc: Phil Sutter, Sedat Dilek, Stephen Rothwell, linux-next,
linux-kernel, netdev, David Miller, Hannes Frederic Sowa,
wireless, John Linville
In-Reply-To: <1375892245.4004.31.camel@edumazet-glaptop>
On Wed, 2013-08-07 at 09:17 -0700, Eric Dumazet wrote:
> On Wed, 2013-08-07 at 18:12 +0200, Johannes Berg wrote:
> > On Wed, 2013-08-07 at 17:59 +0200, Phil Sutter wrote:
> >
> > > The idea behind this patch is that users setting the protocol to
> > > something else probably do know better and so should be left alone.
> >
> > Regardless of that, I think that still the skb pointers would be changed
> > by this patch which would confuse the receiver of the SKB (device
> > driver), no? Has anyone verified that theory? :)
>
> Maybe receivers made wrong assumptions about some headers being set or
> not set ?
Maybe. I haven't tested it, but I'm thinking that skb->data doesn't
point to the start of the data frame in this case, since we now call
eth_type_trans() which pulls the ethernet header. So if the device just
transmits skb->len starting from skb->data, it'll be wrong, no? That
seems a basic assumption though.
johannes
^ permalink raw reply
* Re: linux-next: Tree for Aug 7
From: Eric Dumazet @ 2013-08-07 16:40 UTC (permalink / raw)
To: Johannes Berg
Cc: Phil Sutter, Sedat Dilek, Stephen Rothwell, linux-next,
linux-kernel, netdev, David Miller, Hannes Frederic Sowa,
wireless, John Linville
In-Reply-To: <1375892522.8154.3.camel@jlt4.sipsolutions.net>
On Wed, 2013-08-07 at 18:22 +0200, Johannes Berg wrote:
> Maybe. I haven't tested it, but I'm thinking that skb->data doesn't
> point to the start of the data frame in this case, since we now call
> eth_type_trans() which pulls the ethernet header. So if the device just
> transmits skb->len starting from skb->data, it'll be wrong, no? That
> seems a basic assumption though.
Yes, it seems calling eth_type_trans() is not right here, and even could
crash.
Sorry, for being vague, I am a bit busy this morning.
^ permalink raw reply
* Re: [RFC 00/53] wireless-regdb: mostly VHT80 updates
From: Luis R. Rodriguez @ 2013-08-07 17:19 UTC (permalink / raw)
To: John W. Linville
Cc: wireless-regdb@lists.infradead.org, linux-wireless,
Luis R. Rodriguez
In-Reply-To: <1372899889-19183-1-git-send-email-mcgrof@do-not-panic.com>
On Wed, Jul 3, 2013 at 6:03 PM, Luis R. Rodriguez
<mcgrof@do-not-panic.com> wrote:
> From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
>
> Here's a series of updates for wireless-regdb. Most of this is
> to just enable VHT80 support to enable support for 802.11ac
> where this has been verified to be usable. I cannot meet the
> criteria of providing full documentation for sources for all
> patches, only a few ones so what I recommend for the rest is
> to let this sit on the list for a bit and I'd hope after
> review if no one spots any issues I'd hope we can merge this.
>
> I reviewed the idea of vendor namespaces on wireless-regdb
> and at least through review with pkgadd on IRC we concluded
> its best to try to take this approach instead of encouraging
> divergence due to any lack of full source documentation or
> inability to provide such documentation for whatever reason.
> This seems to be better than not getting any updates at all
> and keeps vendors hopefully encouraged to push changes upstream.
John,
I addressed all comments and its been a while without any negative
feedback on the patches. If you do decide to merge I put the delta on
this tree to make it easy to pull, on the master branch.
git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/wireless-regdb.git
Luis
^ permalink raw reply
* Re: linux-next: Tree for Aug 7
From: David Miller @ 2013-08-07 17:47 UTC (permalink / raw)
To: eric.dumazet
Cc: johannes, phil, sedat.dilek, sfr, linux-next, linux-kernel,
netdev, hannes, linux-wireless, linville
In-Reply-To: <1375893609.4004.33.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 07 Aug 2013 09:40:09 -0700
> On Wed, 2013-08-07 at 18:22 +0200, Johannes Berg wrote:
>
>> Maybe. I haven't tested it, but I'm thinking that skb->data doesn't
>> point to the start of the data frame in this case, since we now call
>> eth_type_trans() which pulls the ethernet header. So if the device just
>> transmits skb->len starting from skb->data, it'll be wrong, no? That
>> seems a basic assumption though.
>
> Yes, it seems calling eth_type_trans() is not right here, and even could
> crash.
>
> Sorry, for being vague, I am a bit busy this morning.
Yes, this is absolutely the core problem, you absolute cannot
call eth_type_trans() on the output path, it pulls off the
ethernet header from the packet. That can't possibly work.
I want a real fix submitted formally for this problem immediately,
or else I'm reverting all of these changes this afternoon.
Thanks.
^ permalink raw reply
* WL-1700USB connection unstable
From: Kristian Skračić @ 2013-08-07 18:08 UTC (permalink / raw)
To: linux-wireless
Hello,
For about 6 months now I have been using the WL-1700USB wireless
adapter. I am using Debian (7) and the rtl8187 driver, while my wireless
is protected with WPA2-PSK.
After I connect to my router via the adapter, everything works fine for
a short while (about 10minutes), and after that the connection speed
starts falling until it is completely frozen and i can't even ping
Google, let alone open a web page.
The adapter works fine on windows, but so far every distribution and/or
fix i tried works the same (I tried Debian 6, Arch linux, Ubuntu 11 and
12...).
I have tried lowering the rate, tx power and other options listed here:
https://wiki.archlinux.org/index.php/Rtl8187_wireless#Connection_always_times_out
I tried playing with the channel settings for the wireless network on my
router - same results.
Another strange think i noticed (although perhaps not relevant to the
deterioration of speed) is that the blue LED light on the adapter is
allways blinking extremely rapidly in all linux distros i tried. While
on Windows, it blinks depending on the current amount of network traffic
(although, even when i am downloading something at full speed on windows
the LED light does not blink that rapidly!).
Hope I gave enough information for someone to point me in the right
direction.
Any feedback regarding this issue is greatly appreciated!
Best regards,
Kristian
^ permalink raw reply
* Re: linux-next: Tree for Aug 7
From: Phil Sutter @ 2013-08-07 18:37 UTC (permalink / raw)
To: David Miller
Cc: eric.dumazet, johannes, sedat.dilek, sfr, linux-next,
linux-kernel, netdev, hannes, linux-wireless, linville
In-Reply-To: <20130807.104713.1615549684239408926.davem@davemloft.net>
On Wed, Aug 07, 2013 at 10:47:13AM -0700, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 07 Aug 2013 09:40:09 -0700
>
> > On Wed, 2013-08-07 at 18:22 +0200, Johannes Berg wrote:
> >
> >> Maybe. I haven't tested it, but I'm thinking that skb->data doesn't
> >> point to the start of the data frame in this case, since we now call
> >> eth_type_trans() which pulls the ethernet header. So if the device just
> >> transmits skb->len starting from skb->data, it'll be wrong, no? That
> >> seems a basic assumption though.
> >
> > Yes, it seems calling eth_type_trans() is not right here, and even could
> > crash.
> >
> > Sorry, for being vague, I am a bit busy this morning.
>
> Yes, this is absolutely the core problem, you absolute cannot
> call eth_type_trans() on the output path, it pulls off the
> ethernet header from the packet. That can't possibly work.
>
> I want a real fix submitted formally for this problem immediately,
> or else I'm reverting all of these changes this afternoon.
One could simply call skb_push(skb, ETH_HLEN) right after calling
eth_type_trans(skb, dev) in order to undo the 'data' and 'len'
adjustment. Not sure if this kind of hack is the right way to go here,
or if the whole af_packet parses ethernet header discussion should be
opened again instead.
Best wishes, Phil
^ permalink raw reply
* [PATCH 1/4] staging: vt6656: rxtx.c: s_uGetDataDuration remove First Frag or Mid Frag dead code.
From: Malcolm Priestley @ 2013-08-07 20:26 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
The driver always calls s_uGetDataDuration with;
uFragIdx = 0, cbLastFragmentSize = 0 and uMACfragNum = 1
uFragIdx == (uMACfragNum-1) is always true and bLastFrag = 1.
Remove dead First Frag or Mid Frag if/else and variables.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rxtx.c | 105 +-----------------------------------------
1 file changed, 1 insertion(+), 104 deletions(-)
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index b26fb2a..d3b9a6b 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -392,147 +392,44 @@ static u32 s_uGetDataDuration(struct vnt_private *pDevice, u8 byDurType,
u32 uFragIdx, u32 cbLastFragmentSize, u32 uMACfragNum,
u8 byFBOption)
{
- int bLastFrag = 0;
- u32 uAckTime = 0, uNextPktTime = 0;
-
- if (uFragIdx == (uMACfragNum-1)) {
- bLastFrag = 1;
- }
+ u32 uAckTime = 0;
switch (byDurType) {
case DATADUR_B: //DATADUR_B
- if (((uMACfragNum == 1)) || (bLastFrag == 1)) {//Non Frag or Last Frag
if (bNeedAck) {
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
return (pDevice->uSIFS + uAckTime);
} else {
return 0;
}
- }
- else {//First Frag or Mid Frag
- if (uFragIdx == (uMACfragNum-2)) {
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wRate, bNeedAck);
- } else {
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
- }
- if (bNeedAck) {
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
- return (pDevice->uSIFS + uAckTime + uNextPktTime);
- } else {
- return (pDevice->uSIFS + uNextPktTime);
- }
- }
break;
case DATADUR_A: //DATADUR_A
- if (((uMACfragNum==1)) || (bLastFrag==1)) {//Non Frag or Last Frag
if(bNeedAck){
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
return (pDevice->uSIFS + uAckTime);
} else {
return 0;
}
- }
- else {//First Frag or Mid Frag
- if(uFragIdx == (uMACfragNum-2)){
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wRate, bNeedAck);
- } else {
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
- }
- if(bNeedAck){
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
- return (pDevice->uSIFS + uAckTime + uNextPktTime);
- } else {
- return (pDevice->uSIFS + uNextPktTime);
- }
- }
break;
case DATADUR_A_F0: //DATADUR_A_F0
- if (((uMACfragNum==1)) || (bLastFrag==1)) {//Non Frag or Last Frag
if(bNeedAck){
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
return (pDevice->uSIFS + uAckTime);
} else {
return 0;
}
- }
- else { //First Frag or Mid Frag
- if (byFBOption == AUTO_FB_0) {
- if (wRate < RATE_18M)
- wRate = RATE_18M;
- else if (wRate > RATE_54M)
- wRate = RATE_54M;
-
- if(uFragIdx == (uMACfragNum-2)){
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt0[FB_RATE0][wRate-RATE_18M], bNeedAck);
- } else {
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate-RATE_18M], bNeedAck);
- }
- } else { // (byFBOption == AUTO_FB_1)
- if (wRate < RATE_18M)
- wRate = RATE_18M;
- else if (wRate > RATE_54M)
- wRate = RATE_54M;
-
- if(uFragIdx == (uMACfragNum-2)){
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt1[FB_RATE0][wRate-RATE_18M], bNeedAck);
- } else {
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate-RATE_18M], bNeedAck);
- }
- }
-
- if(bNeedAck){
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
- return (pDevice->uSIFS + uAckTime + uNextPktTime);
- } else {
- return (pDevice->uSIFS + uNextPktTime);
- }
- }
break;
case DATADUR_A_F1: //DATADUR_A_F1
- if (((uMACfragNum==1)) || (bLastFrag==1)) {//Non Frag or Last Frag
if(bNeedAck){
uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
return (pDevice->uSIFS + uAckTime);
} else {
return 0;
}
- }
- else { //First Frag or Mid Frag
- if (byFBOption == AUTO_FB_0) {
- if (wRate < RATE_18M)
- wRate = RATE_18M;
- else if (wRate > RATE_54M)
- wRate = RATE_54M;
-
- if(uFragIdx == (uMACfragNum-2)){
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt0[FB_RATE1][wRate-RATE_18M], bNeedAck);
- } else {
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate-RATE_18M], bNeedAck);
- }
-
- } else { // (byFBOption == AUTO_FB_1)
- if (wRate < RATE_18M)
- wRate = RATE_18M;
- else if (wRate > RATE_54M)
- wRate = RATE_54M;
-
- if(uFragIdx == (uMACfragNum-2)){
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt1[FB_RATE1][wRate-RATE_18M], bNeedAck);
- } else {
- uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate-RATE_18M], bNeedAck);
- }
- }
- if(bNeedAck){
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
- return (pDevice->uSIFS + uAckTime + uNextPktTime);
- } else {
- return (pDevice->uSIFS + uNextPktTime);
- }
- }
break;
default:
--
1.8.1.2
^ permalink raw reply related
* [PATCH 2/4] staging: vt6656: rxtx.c: s_uGetDataDuration remove dead variables.
From: Malcolm Priestley @ 2013-08-07 20:28 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
As result of patch
staging: vt6656: rxtx.c s_uGetDataDuration remove First Frag or Mid Frag dead code.
cbFrameLength, wRate, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption are
dead variables.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rxtx.c | 74 ++++++++++++++++++-------------------------
1 file changed, 30 insertions(+), 44 deletions(-)
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index d3b9a6b..2751531 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -135,9 +135,7 @@ static void s_vFillRTSHead(struct vnt_private *pDevice, u8 byPktType,
struct ethhdr *psEthHeader, u16 wCurrentRate, u8 byFBOption);
static u32 s_uGetDataDuration(struct vnt_private *pDevice, u8 byDurType,
- u32 cbFrameLength, u8 byPktType, u16 wRate, int bNeedAck,
- u32 uFragIdx, u32 cbLastFragmentSize, u32 uMACfragNum,
- u8 byFBOption);
+ u8 byPktType, int bNeedAck);
static unsigned int s_uGetRTSCTSDuration(struct vnt_private *pDevice,
u8 byDurType, u32 cbFrameLength, u8 byPktType, u16 wRate,
@@ -388,9 +386,7 @@ static u32 s_uGetRTSCTSRsvTime(struct vnt_private *pDevice,
//byFreqType 0: 5GHz, 1:2.4Ghz
static u32 s_uGetDataDuration(struct vnt_private *pDevice, u8 byDurType,
- u32 cbFrameLength, u8 byPktType, u16 wRate, int bNeedAck,
- u32 uFragIdx, u32 cbLastFragmentSize, u32 uMACfragNum,
- u8 byFBOption)
+ u8 byPktType, int bNeedAck)
{
u32 uAckTime = 0;
@@ -545,10 +541,8 @@ static u32 s_uFillDataHead(struct vnt_private *pDevice,
(u16 *)&(pBuf->wTransmitLength), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
);
//Get Duration and TimeStampOff
- pBuf->wDuration = (u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType,
- wCurrentRate, bNeedAck, uFragIdx,
- cbLastFragmentSize, uMACfragNum,
- byFBOption); //1: 2.4GHz
+ pBuf->wDuration = (u16)s_uGetDataDuration(pDevice, DATADUR_A,
+ byPktType, bNeedAck);
if(uDMAIdx!=TYPE_ATIMDMA) {
pBuf->wTimeStampOff = wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE];
}
@@ -565,14 +559,10 @@ static u32 s_uFillDataHead(struct vnt_private *pDevice,
(u16 *)&(pBuf->wTransmitLength_b), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
);
//Get Duration and TimeStamp
- pBuf->wDuration_a = (u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength,
- byPktType, wCurrentRate, bNeedAck, uFragIdx,
- cbLastFragmentSize, uMACfragNum,
- byFBOption); //1: 2.4GHz
- pBuf->wDuration_b = (u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength,
- PK_TYPE_11B, pDevice->byTopCCKBasicRate,
- bNeedAck, uFragIdx, cbLastFragmentSize,
- uMACfragNum, byFBOption); //1: 2.4GHz
+ pBuf->wDuration_a = (u16)s_uGetDataDuration(pDevice, DATADUR_A,
+ byPktType, bNeedAck);
+ pBuf->wDuration_b = (u16)s_uGetDataDuration(pDevice, DATADUR_B,
+ PK_TYPE_11B, bNeedAck);
pBuf->wTimeStampOff_a = wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE];
pBuf->wTimeStampOff_b = wTimeStampOff[pDevice->byPreambleType%2][pDevice->byTopCCKBasicRate%MAX_RATE];
@@ -588,14 +578,14 @@ static u32 s_uFillDataHead(struct vnt_private *pDevice,
(u16 *)&(pBuf->wTransmitLength_b), (u8 *)&(pBuf->byServiceField_b), (u8 *)&(pBuf->bySignalField_b)
);
//Get Duration and TimeStamp
- pBuf->wDuration_a = (u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType,
- wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption); //1: 2.4GHz
- pBuf->wDuration_b = (u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, PK_TYPE_11B,
- pDevice->byTopCCKBasicRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption); //1: 2.4GHz
- pBuf->wDuration_a_f0 = (u16)s_uGetDataDuration(pDevice, DATADUR_A_F0, cbFrameLength, byPktType,
- wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption); //1: 2.4GHz
- pBuf->wDuration_a_f1 = (u16)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType,
- wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption); //1: 2.4GHz
+ pBuf->wDuration_a = (u16)s_uGetDataDuration(pDevice, DATADUR_A,
+ byPktType, bNeedAck);
+ pBuf->wDuration_b = (u16)s_uGetDataDuration(pDevice, DATADUR_B,
+ PK_TYPE_11B, bNeedAck);
+ pBuf->wDuration_a_f0 = (u16)s_uGetDataDuration(pDevice,
+ DATADUR_A_F0, byPktType, bNeedAck);
+ pBuf->wDuration_a_f1 = (u16)s_uGetDataDuration(pDevice,
+ DATADUR_A_F1, byPktType, bNeedAck);
pBuf->wTimeStampOff_a = wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE];
pBuf->wTimeStampOff_b = wTimeStampOff[pDevice->byPreambleType%2][pDevice->byTopCCKBasicRate%MAX_RATE];
return (pBuf->wDuration_a);
@@ -611,12 +601,12 @@ static u32 s_uFillDataHead(struct vnt_private *pDevice,
(u16 *)&(pBuf->wTransmitLength), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
);
//Get Duration and TimeStampOff
- pBuf->wDuration = (u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType,
- wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption); //0: 5GHz
- pBuf->wDuration_f0 = (u16)s_uGetDataDuration(pDevice, DATADUR_A_F0, cbFrameLength, byPktType,
- wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption); //0: 5GHz
- pBuf->wDuration_f1 = (u16)s_uGetDataDuration(pDevice, DATADUR_A_F1, cbFrameLength, byPktType,
- wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption); //0: 5GHz
+ pBuf->wDuration = (u16)s_uGetDataDuration(pDevice, DATADUR_A,
+ byPktType, bNeedAck);
+ pBuf->wDuration_f0 = (u16)s_uGetDataDuration(pDevice,
+ DATADUR_A_F0, byPktType, bNeedAck);
+ pBuf->wDuration_f1 = (u16)s_uGetDataDuration(pDevice,
+ DATADUR_A_F1, byPktType, bNeedAck);
if(uDMAIdx!=TYPE_ATIMDMA) {
pBuf->wTimeStampOff = wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE];
}
@@ -628,10 +618,8 @@ static u32 s_uFillDataHead(struct vnt_private *pDevice,
(u16 *)&(pBuf->wTransmitLength), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
);
//Get Duration and TimeStampOff
- pBuf->wDuration = (u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType,
- wCurrentRate, bNeedAck, uFragIdx,
- cbLastFragmentSize, uMACfragNum,
- byFBOption);
+ pBuf->wDuration = (u16)s_uGetDataDuration(pDevice, DATADUR_A,
+ byPktType, bNeedAck);
if(uDMAIdx!=TYPE_ATIMDMA) {
pBuf->wTimeStampOff = wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE];
@@ -646,10 +634,8 @@ static u32 s_uFillDataHead(struct vnt_private *pDevice,
(u16 *)&(pBuf->wTransmitLength), (u8 *)&(pBuf->byServiceField), (u8 *)&(pBuf->bySignalField)
);
//Get Duration and TimeStampOff
- pBuf->wDuration = (u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameLength, byPktType,
- wCurrentRate, bNeedAck, uFragIdx,
- cbLastFragmentSize, uMACfragNum,
- byFBOption);
+ pBuf->wDuration = (u16)s_uGetDataDuration(pDevice, DATADUR_B,
+ byPktType, bNeedAck);
if (uDMAIdx != TYPE_ATIMDMA) {
pBuf->wTimeStampOff = wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE];
}
@@ -1834,8 +1820,8 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
(u16 *)&(pTxDataHead->wTransmitLength), (u8 *)&(pTxDataHead->byServiceField), (u8 *)&(pTxDataHead->bySignalField)
);
//Get Duration and TimeStampOff
- pTxDataHead->wDuration = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameSize, PK_TYPE_11A,
- wCurrentRate, false, 0, 0, 1, AUTO_FB_NONE));
+ pTxDataHead->wDuration = cpu_to_le16((u16)s_uGetDataDuration(pDevice,
+ DATADUR_A, PK_TYPE_11A, false));
pTxDataHead->wTimeStampOff = wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE];
cbHeaderSize = wTxBufSize + sizeof(STxDataHead_ab);
} else {
@@ -1847,8 +1833,8 @@ CMD_STATUS csBeacon_xmit(struct vnt_private *pDevice,
(u16 *)&(pTxDataHead->wTransmitLength), (u8 *)&(pTxDataHead->byServiceField), (u8 *)&(pTxDataHead->bySignalField)
);
//Get Duration and TimeStampOff
- pTxDataHead->wDuration = cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_B, cbFrameSize, PK_TYPE_11B,
- wCurrentRate, false, 0, 0, 1, AUTO_FB_NONE));
+ pTxDataHead->wDuration = cpu_to_le16((u16)s_uGetDataDuration(pDevice,
+ DATADUR_B, PK_TYPE_11B, false));
pTxDataHead->wTimeStampOff = wTimeStampOff[pDevice->byPreambleType%2][wCurrentRate%MAX_RATE];
cbHeaderSize = wTxBufSize + sizeof(STxDataHead_ab);
}
--
1.8.1.2
^ permalink raw reply related
* [PATCH 3/4] staging: vt6656: rxtx.c s_uFillDataHead remove dead variables.
From: Malcolm Priestley @ 2013-08-07 20:31 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
As result of patches
staging: vt6656: rxtx.c: s_uGetDataDuration remove First Frag or Mid Frag dead code
staging: vt6656: rxtx.c: s_uGetDataDuration remove dead variables.
variables uFragIdx, cbLastFragmentSize, uMACfragNum are dead.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rxtx.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 2751531..70a30d9 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -106,8 +106,7 @@ static void s_vGenerateTxParameter(struct vnt_private *pDevice,
static u32 s_uFillDataHead(struct vnt_private *pDevice,
u8 byPktType, u16 wCurrentRate, void *pTxDataHead, u32 cbFrameLength,
- u32 uDMAIdx, int bNeedAck, u32 uFragIdx, u32 cbLastFragmentSize,
- u32 uMACfragNum, u8 byFBOption);
+ u32 uDMAIdx, int bNeedAck, u8 byFBOption);
static void s_vGenerateMACHeader(struct vnt_private *pDevice,
u8 *pbyBufferAddr, u16 wDuration, struct ethhdr *psEthHeader,
@@ -525,8 +524,7 @@ static u32 s_uGetRTSCTSDuration(struct vnt_private *pDevice, u8 byDurType,
static u32 s_uFillDataHead(struct vnt_private *pDevice,
u8 byPktType, u16 wCurrentRate, void *pTxDataHead, u32 cbFrameLength,
- u32 uDMAIdx, int bNeedAck, u32 uFragIdx, u32 cbLastFragmentSize,
- u32 uMACfragNum, u8 byFBOption)
+ u32 uDMAIdx, int bNeedAck, u8 byFBOption)
{
if (pTxDataHead == NULL) {
@@ -1268,7 +1266,7 @@ static int s_bPacketToWirelessUsb(struct vnt_private *pDevice, u8 byPktType,
cbFrameSize, bNeedACK, uDMAIdx, psEthHeader);
//Fill DataHead
uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, uDMAIdx, bNeedACK,
- 0, 0, 1/*uMACfragNum*/, byFBOption);
+ byFBOption);
// Generate TX MAC Header
s_vGenerateMACHeader(pDevice, pbyMacHdr, (u16)uDuration, psEthHeader, bNeedEncryption,
byFragType, uDMAIdx, 0);
@@ -1690,7 +1688,7 @@ CMD_STATUS csMgmt_xmit(struct vnt_private *pDevice,
//Fill DataHead
uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK,
- 0, 0, 1, AUTO_FB_NONE);
+ AUTO_FB_NONE);
pMACHeader = (struct ieee80211_hdr *) (pbyTxBufferAddr + cbHeaderSize);
@@ -2094,7 +2092,7 @@ void vDMA0_tx_80211(struct vnt_private *pDevice, struct sk_buff *skb)
//Fill DataHead
uDuration = s_uFillDataHead(pDevice, byPktType, wCurrentRate, pvTxDataHd, cbFrameSize, TYPE_TXDMA0, bNeedACK,
- 0, 0, 1, AUTO_FB_NONE);
+ AUTO_FB_NONE);
pMACHeader = (struct ieee80211_hdr *) (pbyTxBufferAddr + cbHeaderSize);
--
1.8.1.2
^ permalink raw reply related
* [PATCH 4/4] staging: vt6656: rxtx.c s:_uGetDataDuration simplify structure
From: Malcolm Priestley @ 2013-08-07 20:33 UTC (permalink / raw)
To: gregkh; +Cc: linux-wireless
A value is only returned when bNeedAck is true.
Only when byDurType == DATADUR_B is different.
Remove switch statement and simplify with if structure.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
drivers/staging/vt6656/rxtx.c | 50 ++++++++-----------------------------------
1 file changed, 9 insertions(+), 41 deletions(-)
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 70a30d9..42f0823 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -389,47 +389,15 @@ static u32 s_uGetDataDuration(struct vnt_private *pDevice, u8 byDurType,
{
u32 uAckTime = 0;
- switch (byDurType) {
-
- case DATADUR_B: //DATADUR_B
- if (bNeedAck) {
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
- return (pDevice->uSIFS + uAckTime);
- } else {
- return 0;
- }
- break;
-
- case DATADUR_A: //DATADUR_A
- if(bNeedAck){
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
- return (pDevice->uSIFS + uAckTime);switch
- } else {
- return 0;
- }
- break;
-
- case DATADUR_A_F0: //DATADUR_A_F0
- if(bNeedAck){
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
- return (pDevice->uSIFS + uAckTime);
- } else {
- return 0;
- }
- break;
-
- case DATADUR_A_F1: //DATADUR_A_F1
- if(bNeedAck){
- uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
- return (pDevice->uSIFS + uAckTime);
- } else {
- return 0;
- }
- break;
-
- default:
- break;
- }
+ if (bNeedAck) {
+ if (byDurType == DATADUR_B)
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType,
+ byPktType, 14, pDevice->byTopCCKBasicRate);
+ else
+ uAckTime = BBuGetFrameTime(pDevice->byPreambleType,
+ byPktType, 14, pDevice->byTopOFDMBasicRate);
+ return pDevice->uSIFS + uAckTime;
+ }
return 0;
}
--
1.8.1.2
^ permalink raw reply related
* Re: [PATCH] udev: fail firmware loading immediately if no search path is defined
From: Andy Lutomirski @ 2013-08-07 21:24 UTC (permalink / raw)
To: Maarten Lankhorst
Cc: Tom Gundersen, Bryan Kadzban, systemd Mailing List,
Linux Wireless List, Johannes Berg, Intel Linux Wireless,
linux-hotplug, Kay Sievers, linux-kernel
In-Reply-To: <5201FCA4.30804@gmail.com>
On Wed, Aug 7, 2013 at 12:52 AM, Maarten Lankhorst
<m.b.lankhorst@gmail.com> wrote:
> Op 07-08-13 02:26, Andy Lutomirski schreef:
>> On Tue, Aug 6, 2013 at 5:24 PM, Tom Gundersen <teg@jklm.no> wrote:
>>> On 6 Aug 2013 18:32, "Bryan Kadzban" <bryan@kadzban.is-a-geek.net> wrote:
>>>> On Tue, Aug 06, 2013 at 11:17:17AM +0200, Tom Gundersen wrote:
>>>>> On Tue, Aug 6, 2013 at 11:11 AM, Tom Gundersen <teg@jklm.no> wrote:
>>>>>> On Tue, Aug 6, 2013 at 10:20 AM, Maarten Lankhorst
>>>>>> <m.b.lankhorst@gmail.com> wrote:
>>>>>>> Op 05-08-13 18:29, Andy Lutomirski schreef:
>>>>>>>> The systemd commit below can delay firmware loading by multiple
>>>>>>>> minutes if CONFIG_FW_LOADER_USER_HELPER=y. Unfortunately no one
>>>>>>>> noticed that the systemd-udev change would break new kernels as well
>>>>>>>> as old kernels.
>>>>>>>>
>>>>>>>> Since the kernel apparently can't count on reasonable userspace
>>>>>>>> support, turn this thing off by default.
>>>>>>>>
>>>>>>>> commit a3bd8447be4ea2ce230eb8ae0e815c04d85fa15a
>>>>>>>> Author: Tom Gundersen <teg@jklm.no>
>>>>>>>> Date: Mon Mar 18 15:12:18 2013 +0100
>>>>>>>>
>>>>>>>> udev: make firmware loading optional and disable by default
>>>>>>>>
>>>>>>>> Distros that whish to support old kernels should set
>>>>>>>>
>>>>>>>> --with-firmware-dirs="/usr/lib/firmware/updates:/usr/lib/firmware"
>>>>>>>> to retain the old behaviour.
>>>>>>>>
>>>>>>> methinks this patch should be reverted then,
>>>>>> Well, all the code is still there, so it can be enabled if anyone
>>>>>> wants it.
>>>>>>
>>>>>>> or a stub should be added to udev to always fail firmware loading so
>>>>>>> timeouts don't occur.
>>>>>> I think the only use (if any) of a userspace firmware loader would be
>>>>>> for anyone who wants a custom one (i.e., not udev), so we shouldn't
>>>>>> just fail the loading from udev unconditionally.
>>>>>>
>>>>>> How about we just improve the udev documentation a bit, similar to
>>>>>> Andy's kernel patch?
>>>>> Sorry, I should first have checked. We already document this in the
>>>>> README:
>>>>>
>>>>>> Userspace firmware loading is deprecated, will go away, and
>>>>>> sometimes causes problems:
>>>>>> CONFIG_FW_LOADER_USER_HELPER=n
>>>> ...And this patch is making the kernel default to the correct behavior,
>>>> instead of the now-broken-by-udev behavior.
>>>>
>>>> I'm not sure I see the issue with it? :-)
>>> Oh yeah this patch is totally the right thing to do, I was just arguing that
>>> there is nothing to be done on the udev side.
>>>
>>>> (Add me to the list of people that think udev is broken too, fwiw. But
>>>> let's at least not leave *both* sides in a broken-by-default state.)
>>> Well I don't think it is too much to ask that the kernel and udev should be
>>> configured in a consistent way. Especially as thing still work even if you
>>> get it wrong, albeit with a delay.
>> Except that the current defaults are inconsistent and there is no
>> explanation anywhere in the logs when this is screwed up.
>>
> So what is wrong with my 'fail in udev immediately if not configured' idea? In that case it
> doesn't matter whether CONFIG_FW_LOADER_USER_HELPER is set or not.
>
> You could even print a useful message for the user in udev to the log, so they have an idea of what
> happened. Breaking udev on older still supported kernels by default without printing any debug info
> is silly, and the only cost is a small increase in disk space when unused. I did so in below patch.
Seems reasonable to me. It might be worth adding something to the
message to suggest turning off CONFIG_FW_LOADER_USER_HELPER.
>
> ~Maarten
>
> I converted < ELEMENTSOF to != ELEMENTSOF in the loop to work correctly when the array is empty.
> Most code in udev-builtin-firmware is eliminated at -O2 optimization level when FIRMWARE_PATH
> is not explicitly set.
>
> 8<----
> diff --git a/Makefile.am b/Makefile.am
> index b8b8d06..2097629 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -2235,6 +2235,7 @@ libudev_core_la_SOURCES = \
> src/udev/udev-ctrl.c \
> src/udev/udev-builtin.c \
> src/udev/udev-builtin-btrfs.c \
> + src/udev/udev-builtin-firmware.c \
> src/udev/udev-builtin-hwdb.c \
> src/udev/udev-builtin-input_id.c \
> src/udev/udev-builtin-keyboard.c \
> @@ -2271,14 +2272,6 @@ libudev_core_la_CPPFLAGS = \
> $(AM_CPPFLAGS) \
> -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
>
> -if ENABLE_FIRMWARE
> -libudev_core_la_SOURCES += \
> - src/udev/udev-builtin-firmware.c
> -
> -dist_udevrules_DATA += \
> - rules/50-firmware.rules
> -endif
> -
> if HAVE_KMOD
> libudev_core_la_SOURCES += \
> src/udev/udev-builtin-kmod.c
> diff --git a/configure.ac b/configure.ac
> index 0ecc716..dc7a3e3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -823,8 +823,6 @@ for i in $with_firmware_path; do
> done
> IFS=$OLD_IFS
> AC_SUBST(FIRMWARE_PATH)
> -AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
> -AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
>
> # ------------------------------------------------------------------------------
> AC_ARG_ENABLE([gudev],
> diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules
> deleted file mode 100644
> index f0ae684..0000000
> --- a/rules/50-firmware.rules
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -# do not edit this file, it will be overwritten on update
> -
> -SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
> diff --git a/rules/50-udev-default.rules b/rules/50-udev-default.rules
> index f764789..645830e 100644
> --- a/rules/50-udev-default.rules
> +++ b/rules/50-udev-default.rules
> @@ -8,6 +8,7 @@ SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
>
> SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
> SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
> +SUBSYSTEM=="firmware", ACTION=="add", IMPORT{builtin}="firmware"
> ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
>
> ACTION!="add", GOTO="default_permissions_end"
> diff --git a/shell-completion/bash/udevadm b/shell-completion/bash/udevadm
> index 8ad8550..c22a3e2 100644
> --- a/shell-completion/bash/udevadm
> +++ b/shell-completion/bash/udevadm
> @@ -83,7 +83,7 @@ _udevadm() {
> fi
> ;;
> 'test-builtin')
> - comps='blkid btrfs hwdb input_id keyboard kmod net_id path_id usb_id uaccess'
> + comps='blkid btrfs firmware hwdb input_id keyboard kmod net_id path_id usb_id uaccess'
> ;;
> *)
> comps=${VERBS[*]}
> diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c
> index b80940b..e678545 100644
> --- a/src/udev/udev-builtin-firmware.c
> +++ b/src/udev/udev-builtin-firmware.c
> @@ -97,7 +97,7 @@ static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], boo
>
> /* lookup firmware file */
> uname(&kernel);
> - for (i = 0; i < ELEMENTSOF(searchpath); i++) {
> + for (i = 0; i != ELEMENTSOF(searchpath); i++) {
> strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
> fwfile = fopen(fwpath, "re");
> if (fwfile != NULL)
> @@ -112,7 +112,10 @@ static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], boo
> strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
>
> if (fwfile == NULL) {
> - log_debug("did not find firmware file '%s'\n", firmware);
> + if (ELEMENTSOF(searchpath))
> + log_debug("did not find firmware file '%s'\n", firmware);
> + else
> + log_error("could not load firmware file '%s', firmware loading not enabled\n", firmware);
> rc = EXIT_FAILURE;
> /*
> * Do not cancel the request in the initrd, the real root might have
> diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
> index 6b3a518..5a5cb30 100644
> --- a/src/udev/udev-builtin.c
> +++ b/src/udev/udev-builtin.c
> @@ -34,9 +34,7 @@ static const struct udev_builtin *builtins[] = {
> [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
> #endif
> [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
> -#ifdef HAVE_FIRMWARE
> [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
> -#endif
> [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
> [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
> [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
> diff --git a/src/udev/udev.h b/src/udev/udev.h
> index 8395926..31fa606 100644
> --- a/src/udev/udev.h
> +++ b/src/udev/udev.h
> @@ -140,9 +140,7 @@ enum udev_builtin_cmd {
> UDEV_BUILTIN_BLKID,
> #endif
> UDEV_BUILTIN_BTRFS,
> -#ifdef HAVE_FIRMWARE
> UDEV_BUILTIN_FIRMWARE,
> -#endif
> UDEV_BUILTIN_HWDB,
> UDEV_BUILTIN_INPUT_ID,
> UDEV_BUILTIN_KEYBOARD,
> @@ -170,9 +168,7 @@ struct udev_builtin {
> extern const struct udev_builtin udev_builtin_blkid;
> #endif
> extern const struct udev_builtin udev_builtin_btrfs;
> -#ifdef HAVE_FIRMWARE
> extern const struct udev_builtin udev_builtin_firmware;
> -#endif
> extern const struct udev_builtin udev_builtin_hwdb;
> extern const struct udev_builtin udev_builtin_input_id;
> extern const struct udev_builtin udev_builtin_keyboard;
> diff --git a/src/udev/udevd.c b/src/udev/udevd.c
> index 45ec3d6..e27a33a 100644
> --- a/src/udev/udevd.c
> +++ b/src/udev/udevd.c
> @@ -98,9 +98,7 @@ struct event {
> dev_t devnum;
> int ifindex;
> bool is_block;
> -#ifdef HAVE_FIRMWARE
> bool nodelay;
> -#endif
> };
>
> static inline struct event *node_to_event(struct udev_list_node *node)
> @@ -444,10 +442,8 @@ static int event_queue_insert(struct udev_device *dev)
> event->devnum = udev_device_get_devnum(dev);
> event->is_block = streq("block", udev_device_get_subsystem(dev));
> event->ifindex = udev_device_get_ifindex(dev);
> -#ifdef HAVE_FIRMWARE
> if (streq(udev_device_get_subsystem(dev), "firmware"))
> event->nodelay = true;
> -#endif
>
> udev_queue_export_device_queued(udev_queue_export, dev);
> log_debug("seq %llu queued, '%s' '%s'\n", udev_device_get_seqnum(dev),
> @@ -527,11 +523,9 @@ static bool is_devpath_busy(struct event *event)
> return true;
> }
>
> -#ifdef HAVE_FIRMWARE
> /* allow to bypass the dependency tracking */
> if (event->nodelay)
> continue;
> -#endif
>
> /* parent device event found */
> if (event->devpath[common] == '/') {
>
--
Andy Lutomirski
AMA Capital Management, LLC
^ permalink raw reply
* Re: [PATCH] backports: rename some mem functions to not break custom kernels
From: Hauke Mehrtens @ 2013-08-07 23:00 UTC (permalink / raw)
To: Arik Nemtsov; +Cc: linux-wireless, mcgrof, backports@vger.kernel.org
In-Reply-To: <1375865563-1196-1-git-send-email-arik@wizery.com>
Please add backports mailing list ( backports@vger.kernel.org ) next time.
On 08/07/2013 10:52 AM, Arik Nemtsov wrote:
> When custom patches are cherry-picked to a kernel, some symbols exported
> by backports may clash with the built-in ones. Rename the backports
> symbols using the standard backport_ prefix to prevent that. Backported
> drivers will resolve to the correct function via a define.
>
> The offending symbols were exported by the patch below:
>
> commit 2ce5c22448bb45998318267c00b5d6ef9cff3170
> Author: Hauke Mehrtens <hauke@hauke-m.de>
> Date: Thu Jun 6 13:48:04 2013 +0200
>
> backports: backport some memory functions
>
> Signed-off-by: Arik Nemtsov <arik@wizery.com>
> ---
> backport/backport-include/asm/mtrr.h | 7 +++++--
> backport/backport-include/linux/io.h | 14 +++++++-------
> backport/compat/backport-3.11.c | 16 ++++++++--------
> 3 files changed, 20 insertions(+), 17 deletions(-)
>
> diff --git a/backport/backport-include/asm/mtrr.h b/backport/backport-include/asm/mtrr.h
> index cf0f6fd..c5760b4 100644
> --- a/backport/backport-include/asm/mtrr.h
> +++ b/backport/backport-include/asm/mtrr.h
> @@ -7,14 +7,17 @@
> * The following functions are for use by other drivers that cannot use
> * arch_phys_wc_add and arch_phys_wc_del.
> */
> +#ifndef phys_wc_to_mtrr_index
> #ifdef CONFIG_MTRR
> -extern int phys_wc_to_mtrr_index(int handle);
> +extern int backport_phys_wc_to_mtrr_index(int handle);
> #else
> -static inline int phys_wc_to_mtrr_index(int handle)
> +static inline int backport_phys_wc_to_mtrr_index(int handle)
> {
> return -1;
> }
> #endif /* CONFIG_MTRR */
> +#define phys_wc_to_mtrr_index LINUX_BACKPORT(phys_wc_to_mtrr_index)
You should put this line before the #ifndef phy_.... and then you do not
have to use backport_phys_wc_to_mtrr_index with the prefix anywhere in
backports. This also applies for the other places where you manually add
backport_.
> +#endif
> #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) */
>
> #endif /* __BACKPORT_ASM_MTRR_H */
> diff --git a/backport/backport-include/linux/io.h b/backport/backport-include/linux/io.h
> index 9a5b308..5f62c62 100644
> --- a/backport/backport-include/linux/io.h
> +++ b/backport/backport-include/linux/io.h
> @@ -15,22 +15,22 @@
> */
> #ifndef arch_phys_wc_add
> #ifdef CONFIG_MTRR
> -extern int __must_check arch_phys_wc_add(unsigned long base,
> - unsigned long size);
> -extern void arch_phys_wc_del(int handle);
> +extern int __must_check backport_arch_phys_wc_add(unsigned long base,
> + unsigned long size);
> +extern void backport_arch_phys_wc_del(int handle);
> #else
> -static inline int __must_check arch_phys_wc_add(unsigned long base,
> - unsigned long size)
> +static inline int __must_check backport_arch_phys_wc_add(unsigned long base,
> + unsigned long size)
> {
> return 0; /* It worked (i.e. did nothing). */
> }
>
> -static inline void arch_phys_wc_del(int handle)
> +static inline void backport_arch_phys_wc_del(int handle)
> {
> }
> #endif /* CONFIG_MTRR */
>
> -#define arch_phys_wc_add arch_phys_wc_add
> +#define arch_phys_wc_add LINUX_BACKPORT(arch_phys_wc_add)
> #endif
>
> #endif /* __BACKPORT_LINUX_IO_H */
> diff --git a/backport/compat/backport-3.11.c b/backport/compat/backport-3.11.c
> index c6d5a02..5ff17d1 100644
> --- a/backport/compat/backport-3.11.c
> +++ b/backport/compat/backport-3.11.c
> @@ -21,7 +21,7 @@
> #define MTRR_TO_PHYS_WC_OFFSET 1000
>
> /**
> - * arch_phys_wc_add - add a WC MTRR and handle errors if PAT is unavailable
> + * backport_arch_phys_wc_add - add a WC MTRR and handle errors if PAT is unavailable
> * @base: Physical base address
> * @size: Size of region
> *
> @@ -32,7 +32,7 @@
> * Drivers must store the return value to pass to mtrr_del_wc_if_needed,
> * but drivers should not try to interpret that return value.
> */
> -int arch_phys_wc_add(unsigned long base, unsigned long size)
> +int backport_arch_phys_wc_add(unsigned long base, unsigned long size)
> {
> int ret;
>
> @@ -49,7 +49,7 @@ int arch_phys_wc_add(unsigned long base, unsigned long size)
> }
> return ret + MTRR_TO_PHYS_WC_OFFSET;
> }
> -EXPORT_SYMBOL_GPL(arch_phys_wc_add);
> +EXPORT_SYMBOL_GPL(backport_arch_phys_wc_add);
>
> /*
> * arch_phys_wc_del - undoes arch_phys_wc_add
> @@ -60,17 +60,17 @@ EXPORT_SYMBOL_GPL(arch_phys_wc_add);
> * The API guarantees that mtrr_del_wc_if_needed(error code) and
> * mtrr_del_wc_if_needed(0) do nothing.
> */
> -void arch_phys_wc_del(int handle)
> +void backport_arch_phys_wc_del(int handle)
> {
> if (handle >= 1) {
> WARN_ON(handle < MTRR_TO_PHYS_WC_OFFSET);
> mtrr_del(handle - MTRR_TO_PHYS_WC_OFFSET, 0, 0);
> }
> }
> -EXPORT_SYMBOL_GPL(arch_phys_wc_del);
> +EXPORT_SYMBOL_GPL(backport_arch_phys_wc_del);
>
> /*
> - * phys_wc_to_mtrr_index - translates arch_phys_wc_add's return value
> + * backport_phys_wc_to_mtrr_index - translates arch_phys_wc_add's return value
> * @handle: Return value from arch_phys_wc_add
> *
> * This will turn the return value from arch_phys_wc_add into an mtrr
> @@ -80,13 +80,13 @@ EXPORT_SYMBOL_GPL(arch_phys_wc_del);
> * in printk line. Alas there is an illegitimate use in some ancient
> * drm ioctls.
> */
> -int phys_wc_to_mtrr_index(int handle)
> +int backport_phys_wc_to_mtrr_index(int handle)
> {
> if (handle < MTRR_TO_PHYS_WC_OFFSET)
> return -1;
> else
> return handle - MTRR_TO_PHYS_WC_OFFSET;
> }
> -EXPORT_SYMBOL_GPL(phys_wc_to_mtrr_index);
> +EXPORT_SYMBOL_GPL(backport_phys_wc_to_mtrr_index);
>
> #endif /* CONFIG_MTRR */
>
^ permalink raw reply
* Re: linux-next: Tree for Aug 7
From: David Miller @ 2013-08-07 23:27 UTC (permalink / raw)
To: phil
Cc: eric.dumazet, johannes, sedat.dilek, sfr, linux-next,
linux-kernel, netdev, hannes, linux-wireless, linville
In-Reply-To: <20130807183758.GB16263@orbit.nwl.cc>
From: Phil Sutter <phil@nwl.cc>
Date: Wed, 7 Aug 2013 20:37:58 +0200
> One could simply call skb_push(skb, ETH_HLEN) right after calling
> eth_type_trans(skb, dev) in order to undo the 'data' and 'len'
> adjustment. Not sure if this kind of hack is the right way to go here,
> or if the whole af_packet parses ethernet header discussion should be
> opened again instead.
That's completely pointless work.
Without that header pull, the only two things left that
eth_type_trans() does is set the skb->protocol field and
set skb->dev.
And even the latter has to be done already in an else
branch in the suspect AF_PACKET code.
So this eth_type_trans() call is 2/3 duplicate or unnecessary work,
it's the completely the wrong thing to do.
Look, I'm going to fix this myself, because I'm pretty tired of
waiting for the obvious fix.
^ permalink raw reply
* Re: linux-next: Tree for Aug 7
From: David Miller @ 2013-08-07 23:36 UTC (permalink / raw)
To: phil
Cc: eric.dumazet, johannes, sedat.dilek, sfr, linux-next,
linux-kernel, netdev, hannes, linux-wireless, linville
In-Reply-To: <20130807.162748.779496444843938176.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Wed, 07 Aug 2013 16:27:48 -0700 (PDT)
> Look, I'm going to fix this myself, because I'm pretty tired of
> waiting for the obvious fix.
Someone please test this:
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index c623861..afc02a6 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -29,6 +29,7 @@
#ifdef __KERNEL__
extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
+extern __be16 __eth_type_trans(struct sk_buff *skb, struct net_device *dev);
extern const struct header_ops eth_header_ops;
extern int eth_header(struct sk_buff *skb, struct net_device *dev,
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index be1f64d..35dc1be 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -146,6 +146,45 @@ int eth_rebuild_header(struct sk_buff *skb)
EXPORT_SYMBOL(eth_rebuild_header);
/**
+ * __eth_type_trans - only determine the packet's protocol ID.
+ * @skb: packet
+ * @dev: device
+ */
+__be16 __eth_type_trans(struct sk_buff *skb, struct net_device *dev)
+{
+ struct ethhdr *eth = (struct ethhdr *) skb->data;
+
+ /*
+ * Some variants of DSA tagging don't have an ethertype field
+ * at all, so we check here whether one of those tagging
+ * variants has been configured on the receiving interface,
+ * and if so, set skb->protocol without looking at the packet.
+ */
+ if (netdev_uses_dsa_tags(dev))
+ return htons(ETH_P_DSA);
+ if (netdev_uses_trailer_tags(dev))
+ return htons(ETH_P_TRAILER);
+
+ if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
+ return eth->h_proto;
+
+ /*
+ * This is a magic hack to spot IPX packets. Older Novell breaks
+ * the protocol design and runs IPX over 802.3 without an 802.2 LLC
+ * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
+ * won't work for fault tolerant netware but does for the rest.
+ */
+ if (skb->len >= 2 && *(unsigned short *)(skb->data) == 0xFFFF)
+ return htons(ETH_P_802_3);
+
+ /*
+ * Real 802.2 LLC
+ */
+ return htons(ETH_P_802_2);
+}
+EXPORT_SYMBOL(__eth_type_trans);
+
+/**
* eth_type_trans - determine the packet's protocol ID.
* @skb: received socket data
* @dev: receiving network device
@@ -184,33 +223,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
skb->pkt_type = PACKET_OTHERHOST;
}
- /*
- * Some variants of DSA tagging don't have an ethertype field
- * at all, so we check here whether one of those tagging
- * variants has been configured on the receiving interface,
- * and if so, set skb->protocol without looking at the packet.
- */
- if (netdev_uses_dsa_tags(dev))
- return htons(ETH_P_DSA);
- if (netdev_uses_trailer_tags(dev))
- return htons(ETH_P_TRAILER);
-
- if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
- return eth->h_proto;
-
- /*
- * This is a magic hack to spot IPX packets. Older Novell breaks
- * the protocol design and runs IPX over 802.3 without an 802.2 LLC
- * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
- * won't work for fault tolerant netware but does for the rest.
- */
- if (skb->len >= 2 && *(unsigned short *)(skb->data) == 0xFFFF)
- return htons(ETH_P_802_3);
-
- /*
- * Real 802.2 LLC
- */
- return htons(ETH_P_802_2);
+ return __eth_type_trans(skb, dev);
}
EXPORT_SYMBOL(eth_type_trans);
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 0c0f6c9..ec8e1c3 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2003,7 +2003,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
return err;
if (dev->type == ARPHRD_ETHER)
- skb->protocol = eth_type_trans(skb, dev);
+ skb->protocol = __eth_type_trans(skb, dev);
data += dev->hard_header_len;
to_write -= dev->hard_header_len;
@@ -2332,13 +2332,13 @@ static int packet_snd(struct socket *sock,
sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags);
if (dev->type == ARPHRD_ETHER) {
- skb->protocol = eth_type_trans(skb, dev);
+ skb->protocol = __eth_type_trans(skb, dev);
if (skb->protocol == htons(ETH_P_8021Q))
reserve += VLAN_HLEN;
} else {
skb->protocol = proto;
- skb->dev = dev;
}
+ skb->dev = dev;
if (!gso_type && (len > dev->mtu + reserve + extra_len)) {
err = -EMSGSIZE;
^ permalink raw reply related
* Re: linux-next: Tree for Aug 7
From: Sedat Dilek @ 2013-08-08 0:02 UTC (permalink / raw)
To: David Miller
Cc: phil, eric.dumazet, johannes, sfr, linux-next, linux-kernel,
netdev, hannes, linux-wireless, linville
In-Reply-To: <20130807.163621.84433966934449459.davem@davemloft.net>
On Thu, Aug 8, 2013 at 1:36 AM, David Miller <davem@davemloft.net> wrote:
> From: David Miller <davem@davemloft.net>
> Date: Wed, 07 Aug 2013 16:27:48 -0700 (PDT)
>
>> Look, I'm going to fix this myself, because I'm pretty tired of
>> waiting for the obvious fix.
>
> Someone please test this:
>
Your patch on top of next-20130807 does not fix the issue in my wifi/network.
No working Internet connection (ping etc.).
- Sedat -
> diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> index c623861..afc02a6 100644
> --- a/include/linux/etherdevice.h
> +++ b/include/linux/etherdevice.h
> @@ -29,6 +29,7 @@
>
> #ifdef __KERNEL__
> extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
> +extern __be16 __eth_type_trans(struct sk_buff *skb, struct net_device *dev);
> extern const struct header_ops eth_header_ops;
>
> extern int eth_header(struct sk_buff *skb, struct net_device *dev,
> diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
> index be1f64d..35dc1be 100644
> --- a/net/ethernet/eth.c
> +++ b/net/ethernet/eth.c
> @@ -146,6 +146,45 @@ int eth_rebuild_header(struct sk_buff *skb)
> EXPORT_SYMBOL(eth_rebuild_header);
>
> /**
> + * __eth_type_trans - only determine the packet's protocol ID.
> + * @skb: packet
> + * @dev: device
> + */
> +__be16 __eth_type_trans(struct sk_buff *skb, struct net_device *dev)
> +{
> + struct ethhdr *eth = (struct ethhdr *) skb->data;
> +
> + /*
> + * Some variants of DSA tagging don't have an ethertype field
> + * at all, so we check here whether one of those tagging
> + * variants has been configured on the receiving interface,
> + * and if so, set skb->protocol without looking at the packet.
> + */
> + if (netdev_uses_dsa_tags(dev))
> + return htons(ETH_P_DSA);
> + if (netdev_uses_trailer_tags(dev))
> + return htons(ETH_P_TRAILER);
> +
> + if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
> + return eth->h_proto;
> +
> + /*
> + * This is a magic hack to spot IPX packets. Older Novell breaks
> + * the protocol design and runs IPX over 802.3 without an 802.2 LLC
> + * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
> + * won't work for fault tolerant netware but does for the rest.
> + */
> + if (skb->len >= 2 && *(unsigned short *)(skb->data) == 0xFFFF)
> + return htons(ETH_P_802_3);
> +
> + /*
> + * Real 802.2 LLC
> + */
> + return htons(ETH_P_802_2);
> +}
> +EXPORT_SYMBOL(__eth_type_trans);
> +
> +/**
> * eth_type_trans - determine the packet's protocol ID.
> * @skb: received socket data
> * @dev: receiving network device
> @@ -184,33 +223,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
> skb->pkt_type = PACKET_OTHERHOST;
> }
>
> - /*
> - * Some variants of DSA tagging don't have an ethertype field
> - * at all, so we check here whether one of those tagging
> - * variants has been configured on the receiving interface,
> - * and if so, set skb->protocol without looking at the packet.
> - */
> - if (netdev_uses_dsa_tags(dev))
> - return htons(ETH_P_DSA);
> - if (netdev_uses_trailer_tags(dev))
> - return htons(ETH_P_TRAILER);
> -
> - if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
> - return eth->h_proto;
> -
> - /*
> - * This is a magic hack to spot IPX packets. Older Novell breaks
> - * the protocol design and runs IPX over 802.3 without an 802.2 LLC
> - * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
> - * won't work for fault tolerant netware but does for the rest.
> - */
> - if (skb->len >= 2 && *(unsigned short *)(skb->data) == 0xFFFF)
> - return htons(ETH_P_802_3);
> -
> - /*
> - * Real 802.2 LLC
> - */
> - return htons(ETH_P_802_2);
> + return __eth_type_trans(skb, dev);
> }
> EXPORT_SYMBOL(eth_type_trans);
>
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index 0c0f6c9..ec8e1c3 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -2003,7 +2003,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
> return err;
>
> if (dev->type == ARPHRD_ETHER)
> - skb->protocol = eth_type_trans(skb, dev);
> + skb->protocol = __eth_type_trans(skb, dev);
>
> data += dev->hard_header_len;
> to_write -= dev->hard_header_len;
> @@ -2332,13 +2332,13 @@ static int packet_snd(struct socket *sock,
> sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags);
>
> if (dev->type == ARPHRD_ETHER) {
> - skb->protocol = eth_type_trans(skb, dev);
> + skb->protocol = __eth_type_trans(skb, dev);
> if (skb->protocol == htons(ETH_P_8021Q))
> reserve += VLAN_HLEN;
> } else {
> skb->protocol = proto;
> - skb->dev = dev;
> }
> + skb->dev = dev;
>
> if (!gso_type && (len > dev->mtu + reserve + extra_len)) {
> err = -EMSGSIZE;
^ permalink raw reply
* Re: linux-next: Tree for Aug 7
From: David Miller @ 2013-08-08 0:09 UTC (permalink / raw)
To: sedat.dilek
Cc: phil, eric.dumazet, johannes, sfr, linux-next, linux-kernel,
netdev, hannes, linux-wireless, linville
In-Reply-To: <CA+icZUUm2nbmVj_WRznPTjXL0y6pcr1GzLjsL7UMhSGQWSm==g@mail.gmail.com>
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Thu, 8 Aug 2013 02:02:48 +0200
> On Thu, Aug 8, 2013 at 1:36 AM, David Miller <davem@davemloft.net> wrote:
>> From: David Miller <davem@davemloft.net>
>> Date: Wed, 07 Aug 2013 16:27:48 -0700 (PDT)
>>
>>> Look, I'm going to fix this myself, because I'm pretty tired of
>>> waiting for the obvious fix.
>>
>> Someone please test this:
>
> Your patch on top of next-20130807 does not fix the issue in my wifi/network.
> No working Internet connection (ping etc.).
Ok, I'm going to simply revert all of these changes, thanks for testing.
^ permalink raw reply
* Re: linux-next: Tree for Aug 7
From: Eric Dumazet @ 2013-08-08 0:06 UTC (permalink / raw)
To: David Miller
Cc: phil, johannes, sedat.dilek, sfr, linux-next, linux-kernel,
netdev, hannes, linux-wireless, linville
In-Reply-To: <20130807.163621.84433966934449459.davem@davemloft.net>
On Wed, 2013-08-07 at 16:36 -0700, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Wed, 07 Aug 2013 16:27:48 -0700 (PDT)
>
> > Look, I'm going to fix this myself, because I'm pretty tired of
> > waiting for the obvious fix.
>
> Someone please test this:
>
> diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> index c623861..afc02a6 100644
> --- a/include/linux/etherdevice.h
> +++ b/include/linux/etherdevice.h
> @@ -29,6 +29,7 @@
>
> #ifdef __KERNEL__
> extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
> +extern __be16 __eth_type_trans(struct sk_buff *skb, struct net_device *dev);
> extern const struct header_ops eth_header_ops;
>
> extern int eth_header(struct sk_buff *skb, struct net_device *dev,
> diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
> index be1f64d..35dc1be 100644
> --- a/net/ethernet/eth.c
> +++ b/net/ethernet/eth.c
> @@ -146,6 +146,45 @@ int eth_rebuild_header(struct sk_buff *skb)
> EXPORT_SYMBOL(eth_rebuild_header);
>
> /**
> + * __eth_type_trans - only determine the packet's protocol ID.
> + * @skb: packet
> + * @dev: device
> + */
> +__be16 __eth_type_trans(struct sk_buff *skb, struct net_device *dev)
> +{
We probably want an inline here
Or else, we are adding an extra function call in rx fast path.
(At least my compiler did this)
0000000000000470 <eth_type_trans>:
470: e8 00 00 00 00 callq 475 <eth_type_trans+0x5>
471: R_X86_64_PC32 __fentry__-0x4
475: 48 8b 8f d0 00 00 00 mov 0xd0(%rdi),%rcx
47c: 48 8b 87 c8 00 00 00 mov 0xc8(%rdi),%rax
483: 44 8b 47 60 mov 0x60(%rdi),%r8d
487: 55 push %rbp
488: 48 89 77 20 mov %rsi,0x20(%rdi)
48c: 48 89 ca mov %rcx,%rdx
48f: 48 89 e5 mov %rsp,%rbp
492: 48 29 c2 sub %rax,%rdx
495: 41 83 f8 0d cmp $0xd,%r8d
499: 66 89 97 b8 00 00 00 mov %dx,0xb8(%rdi)
4a0: 76 19 jbe 4bb <eth_type_trans+0x4b>
4a2: 41 83 e8 0e sub $0xe,%r8d
4a6: 44 3b 47 64 cmp 0x64(%rdi),%r8d
4aa: 44 89 47 60 mov %r8d,0x60(%rdi)
4ae: 72 36 jb 4e6 <eth_type_trans+0x76>
4b0: 48 83 c1 0e add $0xe,%rcx
4b4: 48 89 8f d0 00 00 00 mov %rcx,0xd0(%rdi)
4bb: 81 e2 ff ff 00 00 and $0xffff,%edx
4c1: 48 01 d0 add %rdx,%rax
4c4: f6 00 01 testb $0x1,(%rax)
4c7: 75 2e jne 4f7 <eth_type_trans+0x87>
4c9: 48 8b 96 88 02 00 00 mov 0x288(%rsi),%rdx
4d0: 48 8b 00 mov (%rax),%rax
4d3: 48 33 02 xor (%rdx),%rax
4d6: 48 c1 e0 10 shl $0x10,%rax
4da: 48 85 c0 test %rax,%rax
4dd: 75 09 jne 4e8 <eth_type_trans+0x78>
4df: e8 00 00 00 00 callq 4e4 <eth_type_trans+0x74>
4e0: R_X86_64_PC32 __eth_type_trans-0x4
4e4: 5d pop %rbp
4e5: c3 retq
4e6: 0f 0b ud2
4e8: 0f b6 47 75 movzbl 0x75(%rdi),%eax
4ec: 83 e0 f8 and $0xfffffff8,%eax
4ef: 83 c8 03 or $0x3,%eax
4f2: 88 47 75 mov %al,0x75(%rdi)
4f5: eb e8 jmp 4df <eth_type_trans+0x6f>
4f7: 48 8b 00 mov (%rax),%rax
4fa: 48 33 86 b8 02 00 00 xor 0x2b8(%rsi),%rax
501: 48 c1 e0 10 shl $0x10,%rax
505: 48 85 c0 test %rax,%rax
508: 0f b6 47 75 movzbl 0x75(%rdi),%eax
50c: 75 0b jne 519 <eth_type_trans+0xa9>
50e: 83 e0 f8 and $0xfffffff8,%eax
511: 83 c8 01 or $0x1,%eax
514: 88 47 75 mov %al,0x75(%rdi)
517: eb c6 jmp 4df <eth_type_trans+0x6f>
519: 83 e0 f8 and $0xfffffff8,%eax
51c: 83 c8 02 or $0x2,%eax
51f: 88 47 75 mov %al,0x75(%rdi)
522: eb bb jmp 4df <eth_type_trans+0x6f>
^ permalink raw reply
* Re: linux-next: Tree for Aug 7
From: David Miller @ 2013-08-08 0:13 UTC (permalink / raw)
To: sedat.dilek
Cc: phil, eric.dumazet, johannes, sfr, linux-next, linux-kernel,
netdev, hannes, linux-wireless, linville
In-Reply-To: <20130807.170926.319558320779361738.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Wed, 07 Aug 2013 17:09:26 -0700 (PDT)
> Ok, I'm going to simply revert all of these changes, thanks for testing.
Here is what I just pushed to net-next:
====================
>From 09effa67a18d893fc4e6f81a3659fc9efef1445e Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@davemloft.net>
Date: Wed, 7 Aug 2013 17:11:00 -0700
Subject: [PATCH] packet: Revert recent header parsing changes.
This reverts commits:
0f75b09c798ed00c30d7d5551b896be883bc2aeb
cbd89acb9eb257ed3b2be867142583fdcf7fdc5b
c483e02614551e44ced3fe6eedda8e36d3277ccc
Amongst other things, it's modifies the SKB header
to pull the ethernet headers off via eth_type_trans()
on the output path which is bogus.
It's causing serious regressions for people.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/packet/af_packet.c | 53 ++++++++++++++++++++++--------------------------
1 file changed, 24 insertions(+), 29 deletions(-)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 0c0f6c9..4cb28a7 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -88,7 +88,6 @@
#include <linux/virtio_net.h>
#include <linux/errqueue.h>
#include <linux/net_tstamp.h>
-#include <linux/if_arp.h>
#ifdef CONFIG_INET
#include <net/inet_common.h>
@@ -1924,7 +1923,7 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
__be16 proto, unsigned char *addr, int hlen)
{
union tpacket_uhdr ph;
- int to_write, offset, len, tp_len, nr_frags, len_max, max_frame_len;
+ int to_write, offset, len, tp_len, nr_frags, len_max;
struct socket *sock = po->sk.sk_socket;
struct page *page;
void *data;
@@ -1947,6 +1946,10 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
tp_len = ph.h1->tp_len;
break;
}
+ if (unlikely(tp_len > size_max)) {
+ pr_err("packet size is too long (%d > %d)\n", tp_len, size_max);
+ return -EMSGSIZE;
+ }
skb_reserve(skb, hlen);
skb_reset_network_header(skb);
@@ -2002,25 +2005,10 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,
if (unlikely(err))
return err;
- if (dev->type == ARPHRD_ETHER)
- skb->protocol = eth_type_trans(skb, dev);
-
data += dev->hard_header_len;
to_write -= dev->hard_header_len;
}
- max_frame_len = dev->mtu + dev->hard_header_len;
- if (skb->protocol == htons(ETH_P_8021Q))
- max_frame_len += VLAN_HLEN;
-
- if (size_max > max_frame_len)
- size_max = max_frame_len;
-
- if (unlikely(tp_len > size_max)) {
- pr_err("packet size is too long (%d > %d)\n", tp_len, size_max);
- return -EMSGSIZE;
- }
-
offset = offset_in_page(data);
len_max = PAGE_SIZE - offset;
len = ((to_write > len_max) ? len_max : to_write);
@@ -2059,7 +2047,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
struct net_device *dev;
__be16 proto;
bool need_rls_dev = false;
- int err;
+ int err, reserve = 0;
void *ph;
struct sockaddr_ll *saddr = (struct sockaddr_ll *)msg->msg_name;
int tp_len, size_max;
@@ -2092,6 +2080,8 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
if (unlikely(dev == NULL))
goto out;
+ reserve = dev->hard_header_len;
+
err = -ENETDOWN;
if (unlikely(!(dev->flags & IFF_UP)))
goto out_put;
@@ -2099,6 +2089,9 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
size_max = po->tx_ring.frame_size
- (po->tp_hdrlen - sizeof(struct sockaddr_ll));
+ if (size_max > dev->mtu + reserve)
+ size_max = dev->mtu + reserve;
+
do {
ph = packet_current_frame(po, &po->tx_ring,
TP_STATUS_SEND_REQUEST);
@@ -2331,20 +2324,22 @@ static int packet_snd(struct socket *sock,
sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags);
- if (dev->type == ARPHRD_ETHER) {
- skb->protocol = eth_type_trans(skb, dev);
- if (skb->protocol == htons(ETH_P_8021Q))
- reserve += VLAN_HLEN;
- } else {
- skb->protocol = proto;
- skb->dev = dev;
- }
-
if (!gso_type && (len > dev->mtu + reserve + extra_len)) {
- err = -EMSGSIZE;
- goto out_free;
+ /* Earlier code assumed this would be a VLAN pkt,
+ * double-check this now that we have the actual
+ * packet in hand.
+ */
+ struct ethhdr *ehdr;
+ skb_reset_mac_header(skb);
+ ehdr = eth_hdr(skb);
+ if (ehdr->h_proto != htons(ETH_P_8021Q)) {
+ err = -EMSGSIZE;
+ goto out_free;
+ }
}
+ skb->protocol = proto;
+ skb->dev = dev;
skb->priority = sk->sk_priority;
skb->mark = sk->sk_mark;
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH] backports: rename some mem functions to not break custom kernels
From: Arik Nemtsov @ 2013-08-08 6:45 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-wireless, mcgrof, backports@vger.kernel.org
In-Reply-To: <5202D173.4050408@hauke-m.de>
On Thu, Aug 8, 2013 at 2:00 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> Please add backports mailing list ( backports@vger.kernel.org ) next time.
Ok. Thanks.
>> diff --git a/backport/backport-include/asm/mtrr.h b/backport/backport-include/asm/mtrr.h
>> index cf0f6fd..c5760b4 100644
>> --- a/backport/backport-include/asm/mtrr.h
>> +++ b/backport/backport-include/asm/mtrr.h
>> @@ -7,14 +7,17 @@
>> * The following functions are for use by other drivers that cannot use
>> * arch_phys_wc_add and arch_phys_wc_del.
>> */
>> +#ifndef phys_wc_to_mtrr_index
>> #ifdef CONFIG_MTRR
>> -extern int phys_wc_to_mtrr_index(int handle);
>> +extern int backport_phys_wc_to_mtrr_index(int handle);
>> #else
>> -static inline int phys_wc_to_mtrr_index(int handle)
>> +static inline int backport_phys_wc_to_mtrr_index(int handle)
>> {
>> return -1;
>> }
>> #endif /* CONFIG_MTRR */
>> +#define phys_wc_to_mtrr_index LINUX_BACKPORT(phys_wc_to_mtrr_index)
>
> You should put this line before the #ifndef phy_.... and then you do not
> have to use backport_phys_wc_to_mtrr_index with the prefix anywhere in
> backports. This also applies for the other places where you manually add
> backport_.
The case I'm trying to un-break here is one where the symbol is
defined by the kernel, even though it's not supposed to. This can
happen if someone cherry-picks patches containing this symbol into
their kernel.
The backported driver is better off using the kernel symbol in that
case I guess?
Arik
^ permalink raw reply
* Re: [PATCH 1/2] ath10k: Remove qca98xx hw1.0 support
From: Bartosz Markowski @ 2013-08-08 7:07 UTC (permalink / raw)
To: 杨枭; +Cc: ath10k, linux-wireless
In-Reply-To: <CAFr7H3WU3djGrj_bGZBWnbA23=CapO85zRgAJH_QUEX+nWHjXA@mail.gmail.com>
On 7 August 2013 15:34, 杨枭 <m3yangxiao@gmail.com> wrote:
> Hi,I want to know which kernel does the ath10k support?
It has been pull to 3.11-rc track.
> Can I install it on the kernel-2.6?
> If not,what's the oldest kernel can the ath10k support?
You may use a compat-drivers backport to compile it.
--
Bartosz
^ permalink raw reply
* [RFC 0/3] ath10k: firmware-related updates
From: Michal Kazior @ 2013-08-08 8:08 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
Hi,
This patchset contains 2 firmware-related upgrades
and 1 fix (that I though is a good pick to include
here, since it's related with HTT tx).
This keeps backward compatbility with old
firmware.
Pozdrawiam / Best regards,
Michal Kazior.
Michal Kazior (3):
ath10k: add support for firmware newer than 636
ath10k: clean up HTT tx tid handling
ath10k: add support for HTT 3.0
drivers/net/wireless/ath/ath10k/htt.c | 16 +++----
drivers/net/wireless/ath/ath10k/htt.h | 12 ++---
drivers/net/wireless/ath/ath10k/htt_tx.c | 70 ++++++++++++++++++++----------
drivers/net/wireless/ath/ath10k/hw.h | 3 ++
drivers/net/wireless/ath/ath10k/mac.c | 17 ++++++--
drivers/net/wireless/ath/ath10k/wmi.c | 29 +++++++++----
drivers/net/wireless/ath/ath10k/wmi.h | 16 +++++--
7 files changed, 111 insertions(+), 52 deletions(-)
--
1.7.9.5
^ permalink raw reply
* [RFC 1/3] ath10k: add support for firmware newer than 636
From: Michal Kazior @ 2013-08-08 8:08 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1375949298-7159-1-git-send-email-michal.kazior@tieto.com>
The mgmt_rx event structure has been expanded.
Since the structure header is expanded the payload
(i.e. mgmt frame) is shifted by a few bytes. This
needs to be taken into account in order to support
both old and new firmware.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.c | 29 +++++++++++++++++++++--------
drivers/net/wireless/ath/ath10k/wmi.h | 16 +++++++++++++---
2 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 55f90c7..fc33713 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -315,7 +315,9 @@ static inline u8 get_rate_idx(u32 rate, enum ieee80211_band band)
static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
{
- struct wmi_mgmt_rx_event *event = (struct wmi_mgmt_rx_event *)skb->data;
+ struct wmi_mgmt_rx_event_abi1 *ev_abi1;
+ struct wmi_mgmt_rx_event_abi2 *ev_abi2;
+ struct wmi_mgmt_rx_hdr_abi1 *ev_hdr;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
struct ieee80211_hdr *hdr;
u32 rx_status;
@@ -325,13 +327,24 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
u32 rate;
u32 buf_len;
u16 fc;
+ int pull_len;
+
+ if (ar->fw_version_build > 636) {
+ ev_abi2 = (struct wmi_mgmt_rx_event_abi2 *)skb->data;
+ ev_hdr = &ev_abi2->hdr.abi1;
+ pull_len = sizeof(*ev_abi2);
+ } else {
+ ev_abi1 = (struct wmi_mgmt_rx_event_abi1 *)skb->data;
+ ev_hdr = &ev_abi1->hdr;
+ pull_len = sizeof(*ev_abi1);
+ }
- channel = __le32_to_cpu(event->hdr.channel);
- buf_len = __le32_to_cpu(event->hdr.buf_len);
- rx_status = __le32_to_cpu(event->hdr.status);
- snr = __le32_to_cpu(event->hdr.snr);
- phy_mode = __le32_to_cpu(event->hdr.phy_mode);
- rate = __le32_to_cpu(event->hdr.rate);
+ channel = __le32_to_cpu(ev_hdr->channel);
+ buf_len = __le32_to_cpu(ev_hdr->buf_len);
+ rx_status = __le32_to_cpu(ev_hdr->status);
+ snr = __le32_to_cpu(ev_hdr->snr);
+ phy_mode = __le32_to_cpu(ev_hdr->phy_mode);
+ rate = __le32_to_cpu(ev_hdr->rate);
memset(status, 0, sizeof(*status));
@@ -358,7 +371,7 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
status->signal = snr + ATH10K_DEFAULT_NOISE_FLOOR;
status->rate_idx = get_rate_idx(rate, status->band);
- skb_pull(skb, sizeof(event->hdr));
+ skb_pull(skb, pull_len);
hdr = (struct ieee80211_hdr *)skb->data;
fc = le16_to_cpu(hdr->frame_control);
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 2c5a4f8..0dd0e10 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -1268,7 +1268,7 @@ struct wmi_scan_event {
* good idea to pass all the fields in the RX status
* descriptor up to the host.
*/
-struct wmi_mgmt_rx_hdr {
+struct wmi_mgmt_rx_hdr_abi1 {
__le32 channel;
__le32 snr;
__le32 rate;
@@ -1277,8 +1277,18 @@ struct wmi_mgmt_rx_hdr {
__le32 status; /* %WMI_RX_STATUS_ */
} __packed;
-struct wmi_mgmt_rx_event {
- struct wmi_mgmt_rx_hdr hdr;
+struct wmi_mgmt_rx_hdr_abi2 {
+ struct wmi_mgmt_rx_hdr_abi1 abi1;
+ __le32 rssi_ctl[4];
+} __packed;
+
+struct wmi_mgmt_rx_event_abi1 {
+ struct wmi_mgmt_rx_hdr_abi1 hdr;
+ u8 buf[0];
+} __packed;
+
+struct wmi_mgmt_rx_event_abi2 {
+ struct wmi_mgmt_rx_hdr_abi2 hdr;
u8 buf[0];
} __packed;
--
1.7.9.5
^ permalink raw reply related
* [RFC 2/3] ath10k: clean up HTT tx tid handling
From: Michal Kazior @ 2013-08-08 8:08 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1375949298-7159-1-git-send-email-michal.kazior@tieto.com>
The tids weren't mapped really properly. This
doesn't fix any known bug but seems the right
thing to do.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/htt.h | 6 ++++--
drivers/net/wireless/ath/ath10k/mac.c | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 318be46..de45d02 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -106,8 +106,10 @@ enum htt_data_tx_desc_flags1 {
};
enum htt_data_tx_ext_tid {
- HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST = 16,
- HTT_DATA_TX_EXT_TID_MGMT = 17,
+ HTT_DATA_TX_EXT_TID_NON_QOS_UNICAST = 16,
+ HTT_DATA_TX_EXT_TID_UNUSED = 17,
+ HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST = 18,
+ HTT_DATA_TX_EXT_TID_MGMT = 19,
HTT_DATA_TX_EXT_TID_INVALID = 31
};
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index cf2ba4d..fb1f24f 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1726,12 +1726,14 @@ static void ath10k_tx(struct ieee80211_hw *hw,
/* we must calculate tid before we apply qos workaround
* as we'd lose the qos control field */
- tid = HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST;
if (ieee80211_is_data_qos(hdr->frame_control) &&
is_unicast_ether_addr(ieee80211_get_DA(hdr))) {
u8 *qc = ieee80211_get_qos_ctl(hdr);
tid = qc[0] & IEEE80211_QOS_CTL_TID_MASK;
- }
+ } else if (is_unicast_ether_addr(ieee80211_get_DA(hdr)))
+ tid = HTT_DATA_TX_EXT_TID_NON_QOS_UNICAST;
+ else
+ tid = HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST;
/* it makes no sense to process injected frames like that */
if (info->control.vif &&
--
1.7.9.5
^ permalink raw reply related
* [RFC 3/3] ath10k: add support for HTT 3.0
From: Michal Kazior @ 2013-08-08 8:08 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
In-Reply-To: <1375949298-7159-1-git-send-email-michal.kazior@tieto.com>
New firmware comes with new HTT protocol version.
In 3.0 the separate mgmt tx command has been
removed. All traffic is to be pushed through data
tx (tx_frm) command with a twist - FW seems to not
be able (yet?) to access tx fragment table so for
manamgement frames frame pointer is passed
directly.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/htt.c | 16 +++----
drivers/net/wireless/ath/ath10k/htt.h | 6 +--
drivers/net/wireless/ath/ath10k/htt_tx.c | 70 ++++++++++++++++++++----------
drivers/net/wireless/ath/ath10k/hw.h | 3 ++
drivers/net/wireless/ath/ath10k/mac.c | 11 ++++-
5 files changed, 69 insertions(+), 37 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c
index 39342c5..44facc1 100644
--- a/drivers/net/wireless/ath/ath10k/htt.c
+++ b/drivers/net/wireless/ath/ath10k/htt.c
@@ -104,21 +104,15 @@ err_htc_attach:
static int ath10k_htt_verify_version(struct ath10k_htt *htt)
{
- ath10k_dbg(ATH10K_DBG_HTT,
- "htt target version %d.%d; host version %d.%d\n",
- htt->target_version_major,
- htt->target_version_minor,
- HTT_CURRENT_VERSION_MAJOR,
- HTT_CURRENT_VERSION_MINOR);
-
- if (htt->target_version_major != HTT_CURRENT_VERSION_MAJOR) {
+ ath10k_dbg(ATH10K_DBG_HTT, "htt target version %d.%d\n",
+ htt->target_version_major, htt->target_version_minor);
+
+ if (htt->target_version_major != 2 &&
+ htt->target_version_major != 3) {
ath10k_err("htt major versions are incompatible!\n");
return -ENOTSUPP;
}
- if (htt->target_version_minor != HTT_CURRENT_VERSION_MINOR)
- ath10k_warn("htt minor version differ but still compatible\n");
-
return 0;
}
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index de45d02..2488623 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -23,9 +23,6 @@
#include "htc.h"
#include "rx_desc.h"
-#define HTT_CURRENT_VERSION_MAJOR 2
-#define HTT_CURRENT_VERSION_MINOR 1
-
enum htt_dbg_stats_type {
HTT_DBG_STATS_WAL_PDEV_TXRX = 1 << 0,
HTT_DBG_STATS_RX_REORDER = 1 << 1,
@@ -45,6 +42,9 @@ enum htt_h2t_msg_type { /* host-to-target */
HTT_H2T_MSG_TYPE_SYNC = 4,
HTT_H2T_MSG_TYPE_AGGR_CFG = 5,
HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 6,
+
+ /* This command is used for sending management frames in HTT < 3.0.
+ * HTT >= 3.0 uses TX_FRM for everything. */
HTT_H2T_MSG_TYPE_MGMT_TX = 7,
HTT_H2T_NUM_MSGS /* keep this last */
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 656c254..dce128a 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -401,10 +401,15 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
goto err;
}
- txfrag = dev_alloc_skb(frag_len);
- if (!txfrag) {
- res = -ENOMEM;
- goto err;
+ /* Since HTT 3.0 there is no separate mgmt tx command. However in case
+ * of mgmt tx using TX_FRM there is not tx fragment list. Instead of tx
+ * fragment list host driver specifies directly frame pointer. */
+ if (!(htt->target_version_major >= 3 && ieee80211_is_mgmt(hdr->frame_control))) {
+ txfrag = dev_alloc_skb(frag_len);
+ if (!txfrag) {
+ res = -ENOMEM;
+ goto err;
+ }
}
if (!IS_ALIGNED((unsigned long)txdesc->data, 4)) {
@@ -427,23 +432,30 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
if (res)
goto err;
- /* tx fragment list must be terminated with zero-entry */
- skb_put(txfrag, frag_len);
- tx_frags = (struct htt_data_tx_desc_frag *)txfrag->data;
- tx_frags[0].paddr = __cpu_to_le32(ATH10K_SKB_CB(msdu)->paddr);
- tx_frags[0].len = __cpu_to_le32(msdu->len);
- tx_frags[1].paddr = __cpu_to_le32(0);
- tx_frags[1].len = __cpu_to_le32(0);
-
- res = ath10k_skb_map(dev, txfrag);
- if (res)
- goto err;
+ /* Since HTT 3.0 there is no separate mgmt tx command. However in case
+ * of mgmt tx using TX_FRM there is not tx fragment list. Instead of tx
+ * fragment list host driver specifies directly frame pointer. */
+ if (!(htt->target_version_major >= 3 && ieee80211_is_mgmt(hdr->frame_control))) {
+ /* tx fragment list must be terminated with zero-entry */
+ skb_put(txfrag, frag_len);
+ tx_frags = (struct htt_data_tx_desc_frag *)txfrag->data;
+ tx_frags[0].paddr = __cpu_to_le32(ATH10K_SKB_CB(msdu)->paddr);
+ tx_frags[0].len = __cpu_to_le32(msdu->len);
+ tx_frags[1].paddr = __cpu_to_le32(0);
+ tx_frags[1].len = __cpu_to_le32(0);
+
+ res = ath10k_skb_map(dev, txfrag);
+ if (res)
+ goto err;
+
+ ath10k_dbg(ATH10K_DBG_HTT, "txfrag 0x%llx\n",
+ (unsigned long long) ATH10K_SKB_CB(txfrag)->paddr);
+ ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "txfrag: ",
+ txfrag->data, frag_len);
+ }
- ath10k_dbg(ATH10K_DBG_HTT, "txfrag 0x%llx msdu 0x%llx\n",
- (unsigned long long) ATH10K_SKB_CB(txfrag)->paddr,
+ ath10k_dbg(ATH10K_DBG_HTT, "msdu 0x%llx\n",
(unsigned long long) ATH10K_SKB_CB(msdu)->paddr);
- ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "txfrag: ",
- txfrag->data, frag_len);
ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "msdu: ",
msdu->data, msdu->len);
@@ -459,8 +471,16 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
if (!ieee80211_has_protected(hdr->frame_control))
flags0 |= HTT_DATA_TX_DESC_FLAGS0_NO_ENCRYPT;
flags0 |= HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT;
- flags0 |= SM(ATH10K_HW_TXRX_NATIVE_WIFI,
- HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE);
+
+ /* Since HTT 3.0 there is no separate mgmt tx command. However in case
+ * of mgmt tx using TX_FRM there is not tx fragment list. Instead of tx
+ * fragment list host driver specifies directly frame pointer. */
+ if (htt->target_version_major >= 3 && ieee80211_is_mgmt(hdr->frame_control))
+ flags0 |= SM(ATH10K_HW_TXRX_MGMT,
+ HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE);
+ else
+ flags0 |= SM(ATH10K_HW_TXRX_NATIVE_WIFI,
+ HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE);
flags1 = 0;
flags1 |= SM((u16)vdev_id, HTT_DATA_TX_DESC_FLAGS1_VDEV_ID);
@@ -468,7 +488,13 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L3_OFFLOAD;
flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L4_OFFLOAD;
- frags_paddr = ATH10K_SKB_CB(txfrag)->paddr;
+ /* Since HTT 3.0 there is no separate mgmt tx command. However in case
+ * of mgmt tx using TX_FRM there is not tx fragment list. Instead of tx
+ * fragment list host driver specifies directly frame pointer. */
+ if (htt->target_version_major >= 3 && ieee80211_is_mgmt(hdr->frame_control))
+ frags_paddr = ATH10K_SKB_CB(msdu)->paddr;
+ else
+ frags_paddr = ATH10K_SKB_CB(txfrag)->paddr;
cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_TX_FRM;
cmd->data_tx.flags0 = flags0;
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 44ed5af..9c5d6fc 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -53,6 +53,9 @@ enum ath10k_hw_txrx_mode {
ATH10K_HW_TXRX_RAW = 0,
ATH10K_HW_TXRX_NATIVE_WIFI = 1,
ATH10K_HW_TXRX_ETHERNET = 2,
+
+ /* Valid for HTT >= 3.0. Used for management frames in TX_FRM. */
+ ATH10K_HW_TXRX_MGMT = 3,
};
enum ath10k_mcast2ucast_mode {
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index fb1f24f..aca423c 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1480,6 +1480,12 @@ static void ath10k_tx_htt(struct ath10k *ar, struct sk_buff *skb)
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
int ret;
+ if (ar->htt.target_version_major >= 3) {
+ /* Since HTT 3.0 there is no separate mgmt tx command */
+ ret = ath10k_htt_tx(&ar->htt, skb);
+ goto exit;
+ }
+
if (ieee80211_is_mgmt(hdr->frame_control))
ret = ath10k_htt_mgmt_tx(&ar->htt, skb);
else if (ieee80211_is_nullfunc(hdr->frame_control))
@@ -1491,6 +1497,7 @@ static void ath10k_tx_htt(struct ath10k *ar, struct sk_buff *skb)
else
ret = ath10k_htt_tx(&ar->htt, skb);
+exit:
if (ret) {
ath10k_warn("tx failed (%d). dropping packet.\n", ret);
ieee80211_free_txskb(ar->hw, skb);
@@ -1726,7 +1733,9 @@ static void ath10k_tx(struct ieee80211_hw *hw,
/* we must calculate tid before we apply qos workaround
* as we'd lose the qos control field */
- if (ieee80211_is_data_qos(hdr->frame_control) &&
+ if (ieee80211_is_mgmt(hdr->frame_control))
+ tid = HTT_DATA_TX_EXT_TID_MGMT;
+ else if (ieee80211_is_data_qos(hdr->frame_control) &&
is_unicast_ether_addr(ieee80211_get_DA(hdr))) {
u8 *qc = ieee80211_get_qos_ctl(hdr);
tid = qc[0] & IEEE80211_QOS_CTL_TID_MASK;
--
1.7.9.5
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox