Commit 30bb89f3 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

Staging: rtl8187se/ieee80211: remove dead _RTL8187_EXT_PATCH_ code

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8efff175
...@@ -109,13 +109,6 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee, ...@@ -109,13 +109,6 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
struct ieee80211_hdr_QOS *hdr_4addr_QoS; struct ieee80211_hdr_QOS *hdr_4addr_QoS;
u8 tid; u8 tid;
#ifdef _RTL8187_EXT_PATCH_
if(ieee->iw_mode == ieee->iw_ext_mode)
{
tid = (hdr->addr2[ETH_ALEN-2] ^ hdr->addr2[ETH_ALEN-1]) & IEEE80211_QOS_TID;
}
else
#endif
if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) { if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
hdr_4addr_QoS = (struct ieee80211_hdr_QOS *)hdr; hdr_4addr_QoS = (struct ieee80211_hdr_QOS *)hdr;
tid = le16_to_cpu(hdr_4addr_QoS->QOS_ctl) & IEEE80211_QOS_TID; tid = le16_to_cpu(hdr_4addr_QoS->QOS_ctl) & IEEE80211_QOS_TID;
...@@ -183,13 +176,6 @@ static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee, ...@@ -183,13 +176,6 @@ static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee,
struct ieee80211_hdr_QOS *hdr_4addr_QoS; struct ieee80211_hdr_QOS *hdr_4addr_QoS;
u8 tid; u8 tid;
#ifdef _RTL8187_EXT_PATCH_
if(ieee->iw_mode == ieee->iw_ext_mode)
{
tid = (hdr->addr2[ETH_ALEN-2] ^ hdr->addr2[ETH_ALEN-1]) & IEEE80211_QOS_TID;
}
else
#endif
if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) { if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
hdr_4addr_QoS = (struct ieee80211_hdr_QOS *)hdr; hdr_4addr_QoS = (struct ieee80211_hdr_QOS *)hdr;
tid = le16_to_cpu(hdr_4addr_QoS->QOS_ctl) & IEEE80211_QOS_TID; tid = le16_to_cpu(hdr_4addr_QoS->QOS_ctl) & IEEE80211_QOS_TID;
...@@ -364,13 +350,6 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, struct sk_buff *skb, ...@@ -364,13 +350,6 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, struct sk_buff *skb,
return 0; return 0;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
#ifdef _RTL8187_EXT_PATCH_
if((ieee->iw_mode == ieee->iw_ext_mode) && (ieee->ext_patch_ieee80211_rx_frame_get_hdrlen))
{
hdrlen = ieee->ext_patch_ieee80211_rx_frame_get_hdrlen(ieee, skb);
}
else
#endif
hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
#ifdef CONFIG_IEEE80211_CRYPT_TKIP #ifdef CONFIG_IEEE80211_CRYPT_TKIP
...@@ -416,13 +395,6 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device* ieee, struct sk_buff *s ...@@ -416,13 +395,6 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device* ieee, struct sk_buff *s
return 0; return 0;
hdr = (struct ieee80211_hdr *) skb->data; hdr = (struct ieee80211_hdr *) skb->data;
#ifdef _RTL8187_EXT_PATCH_
if((ieee->iw_mode == ieee->iw_ext_mode) && (ieee->ext_patch_ieee80211_rx_frame_get_hdrlen))
{
hdrlen = ieee->ext_patch_ieee80211_rx_frame_get_hdrlen(ieee, skb);
}
else
#endif
hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
atomic_inc(&crypt->refcnt); atomic_inc(&crypt->refcnt);
...@@ -454,13 +426,6 @@ static int is_duplicate_packet(struct ieee80211_device *ieee, ...@@ -454,13 +426,6 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
struct ieee80211_hdr_QOS *hdr_4addr_QoS; struct ieee80211_hdr_QOS *hdr_4addr_QoS;
u8 tid; u8 tid;
#ifdef _RTL8187_EXT_PATCH_
if(ieee->iw_mode == ieee->iw_ext_mode)
{
tid = (header->addr2[ETH_ALEN-2] ^ header->addr2[ETH_ALEN-1]) & IEEE80211_QOS_TID;
}
else
#endif
//TO2DS and QoS //TO2DS and QoS
if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) { if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
hdr_4addr_QoS = (struct ieee80211_hdr_QOS *)header; hdr_4addr_QoS = (struct ieee80211_hdr_QOS *)header;
...@@ -515,16 +480,6 @@ static int is_duplicate_packet(struct ieee80211_device *ieee, ...@@ -515,16 +480,6 @@ static int is_duplicate_packet(struct ieee80211_device *ieee,
break; break;
default: default:
#ifdef _RTL8187_EXT_PATCH_
if(ieee->iw_mode == ieee->iw_ext_mode)
{
last_seq = &ieee->last_rxseq_num[tid];
last_frag = &ieee->last_rxfrag_num[tid];
last_time = &ieee->last_packet_time[tid];
break;
}
else
#endif
return 0; return 0;
} }
...@@ -589,11 +544,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -589,11 +544,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
struct ieee80211_crypt_data *crypt = NULL; struct ieee80211_crypt_data *crypt = NULL;
int keyidx = 0; int keyidx = 0;
//Added for mesh by Lawrence.
#ifdef _RTL8187_EXT_PATCH_
u8 status;
u32 flags;
#endif
// cheat the the hdr type // cheat the the hdr type
hdr = (struct ieee80211_hdr *)skb->data; hdr = (struct ieee80211_hdr *)skb->data;
stats = &ieee->stats; stats = &ieee->stats;
...@@ -628,15 +578,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -628,15 +578,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
} }
//YJ,add,080828,for keep alive,end //YJ,add,080828,for keep alive,end
#ifdef _RTL8187_EXT_PATCH_
if((ieee->iw_mode == ieee->iw_ext_mode) && (ieee->ext_patch_ieee80211_rx_frame_get_hdrlen))
{
hdrlen = ieee->ext_patch_ieee80211_rx_frame_get_hdrlen(ieee, skb);
if(skb->len < hdrlen)
goto rx_dropped;
}
else
#endif
hdrlen = ieee80211_get_hdrlen(fc); hdrlen = ieee80211_get_hdrlen(fc);
#ifdef NOT_YET #ifdef NOT_YET
...@@ -705,11 +646,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -705,11 +646,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
if (skb->len < IEEE80211_DATA_HDR3_LEN) if (skb->len < IEEE80211_DATA_HDR3_LEN)
goto rx_dropped; goto rx_dropped;
#ifdef _RTL8187_EXT_PATCH_
if( ieee->iw_mode == ieee->iw_ext_mode && ieee->ext_patch_ieee80211_rx_mgt_update_expire )
ieee->ext_patch_ieee80211_rx_mgt_update_expire( ieee, skb );
#endif
// if QoS enabled, should check the sequence for each of the AC // if QoS enabled, should check the sequence for each of the AC
if (is_duplicate_packet(ieee, hdr)) if (is_duplicate_packet(ieee, hdr))
goto rx_dropped; goto rx_dropped;
...@@ -737,15 +673,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -737,15 +673,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
else else
goto rx_exit; goto rx_exit;
} }
#ifdef _RTL8187_EXT_PATCH_
if((ieee->iw_mode == ieee->iw_ext_mode) && ieee->ext_patch_ieee80211_rx_on_rx)
{
if(ieee->ext_patch_ieee80211_rx_on_rx(ieee, skb, rx_stats, type, stype)==0)
{
goto rx_exit;
}
}
#endif
/* Data frame - extract src/dst addresses */ /* Data frame - extract src/dst addresses */
switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) {
...@@ -814,14 +741,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -814,14 +741,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
} }
#endif #endif
#ifdef _RTL8187_EXT_PATCH_
if((ieee->iw_mode == ieee->iw_ext_mode) && ieee->ext_patch_ieee80211_rx_is_valid_framectl)
{
if(ieee->ext_patch_ieee80211_rx_is_valid_framectl(ieee, fc, type, stype)==0)
goto rx_dropped;
}
else
#endif
/* Nullfunc frames may have PS-bit set, so they must be passed to /* Nullfunc frames may have PS-bit set, so they must be passed to
* hostap_handle_sta_rx() before being dropped here. */ * hostap_handle_sta_rx() before being dropped here. */
if (stype != IEEE80211_STYPE_DATA && if (stype != IEEE80211_STYPE_DATA &&
...@@ -989,22 +908,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -989,22 +908,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
} }
#endif #endif
#ifdef _RTL8187_EXT_PATCH_
if((ieee->iw_mode == ieee->iw_ext_mode) && ieee->ext_patch_ieee80211_rx_process_dataframe)
{
//Added for mesh rx interrupt.
//spin_lock_irqsave(&ieee->lock,flags);
status = ieee->ext_patch_ieee80211_rx_process_dataframe(ieee, skb, rx_stats);
//spin_unlock_irqrestore(&ieee->lock,flags);
if(status)
// if(ieee->ext_patch_ieee80211_rx_process_dataframe(ieee, skb, rx_stats))
goto rx_exit;
else
goto rx_dropped;
}
#endif
/* convert hdr + possible LLC headers into Ethernet header */ /* convert hdr + possible LLC headers into Ethernet header */
if (skb->len - hdrlen >= 8 && if (skb->len - hdrlen >= 8 &&
((memcmp(payload, rfc1042_header, SNAP_SIZE) == 0 && ((memcmp(payload, rfc1042_header, SNAP_SIZE) == 0 &&
...@@ -1095,41 +998,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1095,41 +998,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
return 0; return 0;
} }
#ifdef _RTL8187_EXT_PATCH_
int ieee_ext_skb_p80211_to_ether(struct sk_buff *skb, int hdrlen, u8 *dst, u8 *src)
{
u8 *payload;
u16 ethertype;
/* skb: hdr + (possible reassembled) full plaintext payload */
payload = skb->data + hdrlen;
ethertype = (payload[6] << 8) | payload[7];
/* convert hdr + possible LLC headers into Ethernet header */
if (skb->len - hdrlen >= 8 &&
((memcmp(payload, rfc1042_header, SNAP_SIZE) == 0 &&
ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
memcmp(payload, bridge_tunnel_header, SNAP_SIZE) == 0)) {
/* remove RFC1042 or Bridge-Tunnel encapsulation and
* replace EtherType */
skb_pull(skb, hdrlen + SNAP_SIZE);
memcpy(skb_push(skb, ETH_ALEN), src, ETH_ALEN);
memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN);
} else {
u16 len;
/* Leave Ethernet header part of hdr and full payload */
skb_pull(skb, hdrlen);
len = htons(skb->len);
memcpy(skb_push(skb, 2), &len, 2);
memcpy(skb_push(skb, ETH_ALEN), src, ETH_ALEN);
memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN);
}
return 1;
}
#endif // _RTL8187_EXT_PATCH_
#define MGMT_FRAME_FIXED_PART_LENGTH 0x24 #define MGMT_FRAME_FIXED_PART_LENGTH 0x24
static inline int ieee80211_is_ofdm_rate(u8 rate) static inline int ieee80211_is_ofdm_rate(u8 rate)
...@@ -1708,13 +1576,6 @@ inline void ieee80211_process_probe_response( ...@@ -1708,13 +1576,6 @@ inline void ieee80211_process_probe_response(
u8 is_beacon = (WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == IEEE80211_STYPE_BEACON)? 1:0; //YJ,add,080819,for hidden ap u8 is_beacon = (WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == IEEE80211_STYPE_BEACON)? 1:0; //YJ,add,080819,for hidden ap
memset(&network, 0, sizeof(struct ieee80211_network)); memset(&network, 0, sizeof(struct ieee80211_network));
//rz
#ifdef _RTL8187_EXT_PATCH_
if((ieee->iw_mode == ieee->iw_ext_mode) && ieee->ext_patch_ieee80211_process_probe_response_1) {
ieee->ext_patch_ieee80211_process_probe_response_1(ieee, beacon, stats);
return;
}
#endif
IEEE80211_DEBUG_SCAN( IEEE80211_DEBUG_SCAN(
"'%s' (" MAC_FMT "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", "'%s' (" MAC_FMT "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
...@@ -1879,9 +1740,6 @@ inline void ieee80211_process_probe_response( ...@@ -1879,9 +1740,6 @@ inline void ieee80211_process_probe_response(
"PROBE RESPONSE" : "BEACON"); "PROBE RESPONSE" : "BEACON");
#endif #endif
#ifdef _RTL8187_EXT_PATCH_
network.ext_entry = target->ext_entry;
#endif
memcpy(target, &network, sizeof(*target)); memcpy(target, &network, sizeof(*target));
list_add_tail(&target->list, &ieee->network_list); list_add_tail(&target->list, &ieee->network_list);
if(ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) if(ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE)
...@@ -1939,18 +1797,6 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee, ...@@ -1939,18 +1797,6 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
ieee80211_process_probe_response( ieee80211_process_probe_response(
ieee, (struct ieee80211_probe_response *)header, stats); ieee, (struct ieee80211_probe_response *)header, stats);
break; break;
//rz
#ifdef _RTL8187_EXT_PATCH_
case IEEE80211_STYPE_PROBE_REQ:
IEEE80211_DEBUG_MGMT("received PROBE REQUEST (%d)\n",
WLAN_FC_GET_STYPE(header->frame_ctl));
IEEE80211_DEBUG_SCAN("Probe request\n");
///
if( ieee->iw_mode == ieee->iw_ext_mode && ieee->ext_patch_ieee80211_rx_mgt_on_probe_req )
ieee->ext_patch_ieee80211_rx_mgt_on_probe_req( ieee, (struct ieee80211_probe_request *)header, stats);
break;
#endif // _RTL8187_EXT_PATCH_
} }
} }
...@@ -1958,7 +1804,4 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee, ...@@ -1958,7 +1804,4 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
EXPORT_SYMBOL(ieee80211_rx_mgt); EXPORT_SYMBOL(ieee80211_rx_mgt);
EXPORT_SYMBOL(ieee80211_rx); EXPORT_SYMBOL(ieee80211_rx);
EXPORT_SYMBOL(ieee80211_network_init); EXPORT_SYMBOL(ieee80211_network_init);
#ifdef _RTL8187_EXT_PATCH_
EXPORT_SYMBOL(ieee_ext_skb_p80211_to_ether);
#endif
#endif #endif
...@@ -304,216 +304,6 @@ ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network) ...@@ -304,216 +304,6 @@ ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network)
return(wme_UP); return(wme_UP);
} }
#ifdef _RTL8187_EXT_PATCH_
// based on part of ieee80211_xmit. Mainly allocate txb. ieee->lock is held
struct ieee80211_txb *ieee80211_ext_alloc_txb(struct sk_buff *skb, struct net_device *dev, struct ieee80211_hdr_3addr *header, int hdr_len, u8 isQoS, u16 *pQOS_ctl, int isEncrypt, struct ieee80211_crypt_data* crypt)
{
struct ieee80211_device *ieee = netdev_priv(dev);
struct ieee80211_txb *txb = NULL;
struct ieee80211_hdr_3addr *frag_hdr;
int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size;
int ether_type;
int bytes, QOS_ctl;
struct sk_buff *skb_frag;
ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto);
/* Advance the SKB to the start of the payload */
skb_pull(skb, sizeof(struct ethhdr));
/* Determine total amount of storage required for TXB packets */
bytes = skb->len + SNAP_SIZE + sizeof(u16);
/* Determine fragmentation size based on destination (multicast
* and broadcast are not fragmented) */
// if (is_multicast_ether_addr(dest) ||
// is_broadcast_ether_addr(dest)) {
if (is_multicast_ether_addr(header->addr1) ||
is_broadcast_ether_addr(header->addr1)) {
frag_size = MAX_FRAG_THRESHOLD;
QOS_ctl = QOS_CTL_NOTCONTAIN_ACK;
}
else {
//printk(KERN_WARNING "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&frag_size = %d\n", frag_size);
frag_size = ieee->fts;//default:392
QOS_ctl = 0;
}
if(isQoS) {
QOS_ctl |= skb->priority; //set in the ieee80211_classify
*pQOS_ctl = cpu_to_le16(QOS_ctl);
}
//printk(KERN_WARNING "header size = %d, QOS_ctl = %x\n", hdr_len,QOS_ctl);
/* Determine amount of payload per fragment. Regardless of if
* this stack is providing the full 802.11 header, one will
* eventually be affixed to this fragment -- so we must account for
* it when determining the amount of payload space. */
//bytes_per_frag = frag_size - (IEEE80211_3ADDR_LEN + (ieee->current_network->QoS_Enable ? 2:0));
bytes_per_frag = frag_size - hdr_len;
if (ieee->config &
(CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS))
bytes_per_frag -= IEEE80211_FCS_LEN;
/* Each fragment may need to have room for encryptiong pre/postfix */
if (isEncrypt)
bytes_per_frag -= crypt->ops->extra_prefix_len +
crypt->ops->extra_postfix_len;
/* Number of fragments is the total bytes_per_frag /
* payload_per_fragment */
nr_frags = bytes / bytes_per_frag;
bytes_last_frag = bytes % bytes_per_frag;
if (bytes_last_frag)
nr_frags++;
else
bytes_last_frag = bytes_per_frag;
/* When we allocate the TXB we allocate enough space for the reserve
* and full fragment bytes (bytes_per_frag doesn't include prefix,
* postfix, header, FCS, etc.) */
txb = ieee80211_alloc_txb(nr_frags, frag_size, GFP_ATOMIC);
if (unlikely(!txb)) {
printk(KERN_WARNING "%s: Could not allocate TXB\n",
ieee->dev->name);
return NULL;
}
txb->encrypted = isEncrypt;
txb->payload_size = bytes;
for (i = 0; i < nr_frags; i++) {
skb_frag = txb->fragments[i];
skb_frag->priority = UP2AC(skb->priority);
if (isEncrypt)
skb_reserve(skb_frag, crypt->ops->extra_prefix_len);
frag_hdr = (struct ieee80211_hdr_3addr *)skb_put(skb_frag, hdr_len);
memcpy(frag_hdr, (void *)header, hdr_len);
/* If this is not the last fragment, then add the MOREFRAGS
* bit to the frame control */
if (i != nr_frags - 1) {
frag_hdr->frame_ctl = cpu_to_le16(
header->frame_ctl | IEEE80211_FCTL_MOREFRAGS);
bytes = bytes_per_frag;
} else {
/* The last fragment takes the remaining length */
bytes = bytes_last_frag;
}
frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0]<<4 | i);
//frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl<<4 | i);
//
/* Put a SNAP header on the first fragment */
if (i == 0) {
ieee80211_put_snap(
skb_put(skb_frag, SNAP_SIZE + sizeof(u16)), ether_type);
bytes -= SNAP_SIZE + sizeof(u16);
}
memcpy(skb_put(skb_frag, bytes), skb->data, bytes);
/* Advance the SKB... */
skb_pull(skb, bytes);
/* Encryption routine will move the header forward in order
* to insert the IV between the header and the payload */
if (isEncrypt)
ieee80211_encrypt_fragment(ieee, skb_frag, hdr_len);
if (ieee->config &
(CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS))
skb_put(skb_frag, 4);
}
// Advance sequence number in data frame.
//printk(KERN_WARNING "QoS Enalbed? %s\n", ieee->current_network.QoS_Enable?"Y":"N");
if (ieee->seq_ctrl[0] == 0xFFF)
ieee->seq_ctrl[0] = 0;
else
ieee->seq_ctrl[0]++;
// stanley, just for debug
/*
{
int j=0;
for(j=0;j<nr_frags;j++)
{
int i;
struct sk_buff *skb = txb->fragments[j];
printk("send(%d): ", j);
for (i=0;i<skb->len;i++)
printk("%02X ", skb->data[i]&0xff);
printk("\n");
}
}
*/
return txb;
}
// based on part of ieee80211_xmit. Mainly allocate txb. ieee->lock is held
// Assume no encryption, no FCS computing
struct ieee80211_txb *ieee80211_ext_reuse_txb(struct sk_buff *skb, struct net_device *dev, struct ieee80211_hdr_3addr *header, int hdr_len, u8 isQoS, u16 *pQOS_ctl, int isEncrypt, struct ieee80211_crypt_data* crypt)
{
struct ieee80211_device *ieee = netdev_priv(dev);
struct ieee80211_txb *txb = NULL;
struct ieee80211_hdr_3addr *frag_hdr;
int ether_type;
int bytes, QOS_ctl;
ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto);
/* Advance the SKB to the start of the payload */
skb_pull(skb, sizeof(struct ethhdr));
/* Determine total amount of storage required for TXB packets */
bytes = skb->len + SNAP_SIZE + sizeof(u16);
if (is_multicast_ether_addr(header->addr1) ||
is_broadcast_ether_addr(header->addr1)) {
QOS_ctl = QOS_CTL_NOTCONTAIN_ACK;
}
else {
QOS_ctl = 0;
}
if(isQoS) {
QOS_ctl |= skb->priority; //set in the ieee80211_classify
*pQOS_ctl = cpu_to_le16(QOS_ctl);
}
txb = kmalloc( sizeof(struct ieee80211_txb) + sizeof(u8*), GFP_ATOMIC );
if (unlikely(!txb)) {
printk(KERN_WARNING "%s: Could not allocate TXB\n",
ieee->dev->name);
return NULL;
}
txb->nr_frags = 1;
txb->frag_size = bytes;
txb->encrypted = isEncrypt;
txb->payload_size = bytes;
txb->fragments[0] = skb;
ieee80211_put_snap(
skb_push(skb, SNAP_SIZE + sizeof(u16)), ether_type);
frag_hdr = (struct ieee80211_hdr_3addr *)skb_push(skb, hdr_len);
memcpy(frag_hdr, (void *)header, hdr_len);
frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0]<<4 | 0);
skb->priority = UP2AC(skb->priority);
// Advance sequence number in data frame.
//printk(KERN_WARNING "QoS Enalbed? %s\n", ieee->current_network.QoS_Enable?"Y":"N");
if (ieee->seq_ctrl[0] == 0xFFF)
ieee->seq_ctrl[0] = 0;
else
ieee->seq_ctrl[0]++;
return txb;
}
#endif // _RTL8187_EXT_PATCH_
/* SKBs are added to the ieee->tx_queue. */ /* SKBs are added to the ieee->tx_queue. */
int ieee80211_xmit(struct sk_buff *skb, int ieee80211_xmit(struct sk_buff *skb,
struct net_device *dev) struct net_device *dev)
...@@ -561,16 +351,6 @@ int ieee80211_xmit(struct sk_buff *skb, ...@@ -561,16 +351,6 @@ int ieee80211_xmit(struct sk_buff *skb,
goto success; goto success;
} }
#ifdef _RTL8187_EXT_PATCH_
// note, skb->priority which was set by ieee80211_classify, and used by physical tx
if((ieee->iw_mode == ieee->iw_ext_mode) && (ieee->ext_patch_ieee80211_xmit))
{
txb = ieee->ext_patch_ieee80211_xmit(skb, dev);
goto success;
}
#endif
ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto); ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto);
crypt = ieee->crypt[ieee->tx_keyidx]; crypt = ieee->crypt[ieee->tx_keyidx];
...@@ -782,10 +562,6 @@ int ieee80211_xmit(struct sk_buff *skb, ...@@ -782,10 +562,6 @@ int ieee80211_xmit(struct sk_buff *skb,
success: success:
spin_unlock_irqrestore(&ieee->lock, flags); spin_unlock_irqrestore(&ieee->lock, flags);
#ifdef _RTL8187_EXT_PATCH_
// Sometimes, extension mode can reuse skb (by txb->fragments[0])
if( ! ((ieee->iw_mode == ieee->iw_ext_mode) && txb && (txb->fragments[0] == skb)) )
#endif
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
if (txb) { if (txb) {
if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){ if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){
...@@ -812,9 +588,4 @@ int ieee80211_xmit(struct sk_buff *skb, ...@@ -812,9 +588,4 @@ int ieee80211_xmit(struct sk_buff *skb,
#if 0 #if 0
EXPORT_SYMBOL(ieee80211_txb_free); EXPORT_SYMBOL(ieee80211_txb_free);
#ifdef _RTL8187_EXT_PATCH_
EXPORT_SYMBOL(ieee80211_alloc_txb);
EXPORT_SYMBOL(ieee80211_ext_alloc_txb);
EXPORT_SYMBOL(ieee80211_ext_reuse_txb);
#endif // _RTL8187_EXT_PATCH_
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment