Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256379
b: refs/heads/master
c: e156103
h: refs/heads/master
i:
  256377: 52e3b4a
  256375: 1a01218
v: v3
  • Loading branch information
Yogesh Ashok Powar authored and John W. Linville committed Jul 8, 2011
1 parent 83b1745 commit 0006f0d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38869d79e5b498bd35c9967231dfb01cdd301bf5
refs/heads/master: e156103cee78a1dd1c0d14efe08aa36fc9285013
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/mwifiex/decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

#define MWIFIEX_MAX_BSS_NUM (1)

#define MWIFIEX_MIN_DATA_HEADER_LEN 32 /* (sizeof(mwifiex_txpd)) */
#define MWIFIEX_MIN_DATA_HEADER_LEN 36 /* sizeof(mwifiex_txpd)
* + 4 byte alignment
*/

#define MWIFIEX_MAX_TX_BASTREAM_SUPPORTED 2
#define MWIFIEX_MAX_RX_BASTREAM_SUPPORTED 16
Expand Down
13 changes: 9 additions & 4 deletions trunk/drivers/net/wireless/mwifiex/sta_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void *mwifiex_process_sta_txpd(struct mwifiex_private *priv,
struct mwifiex_adapter *adapter = priv->adapter;
struct txpd *local_tx_pd;
struct mwifiex_txinfo *tx_info = MWIFIEX_SKB_TXCB(skb);
u8 pad;

if (!skb->len) {
dev_err(adapter->dev, "Tx: bad packet length: %d\n",
Expand All @@ -55,15 +56,19 @@ void *mwifiex_process_sta_txpd(struct mwifiex_private *priv,
return skb->data;
}

BUG_ON(skb_headroom(skb) < (sizeof(*local_tx_pd) + INTF_HEADER_LEN));
skb_push(skb, sizeof(*local_tx_pd));
/* If skb->data is not aligned; add padding */
pad = (4 - (((void *)skb->data - NULL) & 0x3)) % 4;

BUG_ON(skb_headroom(skb) < (sizeof(*local_tx_pd) + INTF_HEADER_LEN
+ pad));
skb_push(skb, sizeof(*local_tx_pd) + pad);

local_tx_pd = (struct txpd *) skb->data;
memset(local_tx_pd, 0, sizeof(struct txpd));
local_tx_pd->bss_num = priv->bss_num;
local_tx_pd->bss_type = priv->bss_type;
local_tx_pd->tx_pkt_length = cpu_to_le16((u16) (skb->len -
sizeof(struct txpd)));
(sizeof(struct txpd) + pad)));

local_tx_pd->priority = (u8) skb->priority;
local_tx_pd->pkt_delay_2ms =
Expand All @@ -88,7 +93,7 @@ void *mwifiex_process_sta_txpd(struct mwifiex_private *priv,
}

/* Offset of actual data */
local_tx_pd->tx_pkt_offset = cpu_to_le16(sizeof(struct txpd));
local_tx_pd->tx_pkt_offset = cpu_to_le16(sizeof(struct txpd) + pad);

/* make space for INTF_HEADER_LEN */
skb_push(skb, INTF_HEADER_LEN);
Expand Down

0 comments on commit 0006f0d

Please sign in to comment.