aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index a903645e157a..5298a8bf1129 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -1130,6 +1130,8 @@ static void zd_mac_rx(struct zd_mac *mac, struct sk_buff *skb)
1130 __skb_trim(skb, skb->len - 1130 __skb_trim(skb, skb->len -
1131 (IEEE80211_FCS_LEN + sizeof(struct rx_status))); 1131 (IEEE80211_FCS_LEN + sizeof(struct rx_status)));
1132 1132
1133 ZD_ASSERT(IS_ALIGNED((unsigned long)skb->data, 4));
1134
1133 update_qual_rssi(mac, skb->data, skb->len, stats.signal, 1135 update_qual_rssi(mac, skb->data, skb->len, stats.signal,
1134 status->signal_strength); 1136 status->signal_strength);
1135 1137
@@ -1166,15 +1168,19 @@ static void do_rx(unsigned long mac_ptr)
1166int zd_mac_rx_irq(struct zd_mac *mac, const u8 *buffer, unsigned int length) 1168int zd_mac_rx_irq(struct zd_mac *mac, const u8 *buffer, unsigned int length)
1167{ 1169{
1168 struct sk_buff *skb; 1170 struct sk_buff *skb;
1171 unsigned int reserved =
1172 ALIGN(max_t(unsigned int,
1173 sizeof(struct zd_rt_hdr), ZD_PLCP_HEADER_SIZE), 4) -
1174 ZD_PLCP_HEADER_SIZE;
1169 1175
1170 skb = dev_alloc_skb(sizeof(struct zd_rt_hdr) + length); 1176 skb = dev_alloc_skb(reserved + length);
1171 if (!skb) { 1177 if (!skb) {
1172 struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac); 1178 struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);
1173 dev_warn(zd_mac_dev(mac), "Could not allocate skb.\n"); 1179 dev_warn(zd_mac_dev(mac), "Could not allocate skb.\n");
1174 ieee->stats.rx_dropped++; 1180 ieee->stats.rx_dropped++;
1175 return -ENOMEM; 1181 return -ENOMEM;
1176 } 1182 }
1177 skb_reserve(skb, sizeof(struct zd_rt_hdr)); 1183 skb_reserve(skb, reserved);
1178 memcpy(__skb_put(skb, length), buffer, length); 1184 memcpy(__skb_put(skb, length), buffer, length);
1179 skb_queue_tail(&mac->rx_queue, skb); 1185 skb_queue_tail(&mac->rx_queue, skb);
1180 tasklet_schedule(&mac->rx_tasklet); 1186 tasklet_schedule(&mac->rx_tasklet);