o wl3501: remove llc_type stuff, not used

parent 5c44f4ac
...@@ -512,7 +512,6 @@ struct wl3501_card { ...@@ -512,7 +512,6 @@ struct wl3501_card {
u16 esbq_confirm_start; u16 esbq_confirm_start;
u16 esbq_confirm_end; u16 esbq_confirm_end;
u16 esbq_confirm; u16 esbq_confirm;
u8 llc_type;
u8 essid[WL3501_ESSID_MAX_LEN]; u8 essid[WL3501_ESSID_MAX_LEN];
unsigned char bssid[ETH_ALEN]; unsigned char bssid[ETH_ALEN];
int ether_type; int ether_type;
......
...@@ -383,58 +383,32 @@ static int wl3501_send_pkt(struct wl3501_card *this, u8 *data, u16 len) ...@@ -383,58 +383,32 @@ static int wl3501_send_pkt(struct wl3501_card *this, u8 *data, u16 len)
sig.next_blk = 0; sig.next_blk = 0;
sig.sig_id = WL3501_SIG_MD_REQ; sig.sig_id = WL3501_SIG_MD_REQ;
sig.data = bf; sig.data = bf;
if (this->llc_type == 1) { if (((*pdata) * 256 + (*(pdata + 1))) > 1500) {
if (((*pdata) * 256 + (*(pdata + 1))) > 1500) { unsigned char addr4[ETH_ALEN] = {
unsigned char addr4[ETH_ALEN] = { [0] = 0xAA, [1] = 0xAA, [2] = 0x03, [4] = 0x00,
[0] = 0xAA, [1] = 0xAA, };
[2] = 0x03, [4] = 0x00,
}; wl3501_set_to_wla(this, bf + 2 +
offsetof(struct wl3501_tx_hdr, addr4),
wl3501_set_to_wla(this, bf + 2 + addr4, sizeof(addr4));
offsetof(struct wl3501_tx_hdr, addr4), sig.size = pktlen + 24 + 4 + 6;
addr4, sizeof(addr4)); if (pktlen > (254 - sizeof(struct wl3501_tx_hdr))) {
sig.size = pktlen + 24 + 4 + 6; tmplen = 254 - sizeof(struct wl3501_tx_hdr);
if (pktlen > pktlen -= tmplen;
(254 - sizeof(struct wl3501_tx_hdr))) {
tmplen =
254 - sizeof(struct wl3501_tx_hdr);
pktlen -= tmplen;
} else {
tmplen = pktlen;
pktlen = 0;
}
wl3501_set_to_wla(this, bf + 2 +
sizeof(struct wl3501_tx_hdr),
pdata, tmplen);
pdata += tmplen;
wl3501_get_from_wla(this, bf, &next,
sizeof(next));
bf = next;
} else { } else {
sig.size = pktlen + 24 + 4 - 2; tmplen = pktlen;
pdata += 2; pktlen = 0;
pktlen -= 2;
if (pktlen >
(254 - sizeof(struct wl3501_tx_hdr) + 6)) {
tmplen = 254 -
sizeof(struct wl3501_tx_hdr) + 6;
pktlen -= tmplen;
} else {
tmplen = pktlen;
pktlen = 0;
}
wl3501_set_to_wla(this, bf + 2 +
offsetof(struct wl3501_tx_hdr, addr4),
pdata, tmplen);
pdata += tmplen;
wl3501_get_from_wla(this, bf, &next,
sizeof(next));
bf = next;
} }
wl3501_set_to_wla(this,
bf + 2 + sizeof(struct wl3501_tx_hdr),
pdata, tmplen);
pdata += tmplen;
wl3501_get_from_wla(this, bf, &next, sizeof(next));
bf = next;
} else { } else {
pktlen += 12; sig.size = pktlen + 24 + 4 - 2;
sig.size = pktlen + 24 + 4; pdata += 2;
pdata -= 12; pktlen -= 2;
if (pktlen > (254 - sizeof(struct wl3501_tx_hdr) + 6)) { if (pktlen > (254 - sizeof(struct wl3501_tx_hdr) + 6)) {
tmplen = 254 - sizeof(struct wl3501_tx_hdr) + 6; tmplen = 254 - sizeof(struct wl3501_tx_hdr) + 6;
pktlen -= tmplen; pktlen -= tmplen;
...@@ -707,62 +681,41 @@ static u16 wl3501_receive(struct wl3501_card *this, u8 *bf, u16 size) ...@@ -707,62 +681,41 @@ static u16 wl3501_receive(struct wl3501_card *this, u8 *bf, u16 size)
size -= 12; size -= 12;
wl3501_get_from_wla(this, this->start_seg + 2, wl3501_get_from_wla(this, this->start_seg + 2,
&next_addr, sizeof(next_addr)); &next_addr, sizeof(next_addr));
if (this->llc_type == 1) { if (this->ether_type == ARPHRD_ETHER) {
if (this->ether_type == ARPHRD_ETHER) { if (size >
if (size > WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr)) {
WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr)) { wl3501_get_from_wla(this,
wl3501_get_from_wla(this, this->start_seg + this->start_seg +
sizeof(struct sizeof(struct wl3501_rx_hdr),
wl3501_rx_hdr), data, data,
WL3501_BLKSZ - WL3501_BLKSZ -
sizeof(struct sizeof(struct wl3501_rx_hdr));
wl3501_rx_hdr)); size -= WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr);
size -= WL3501_BLKSZ - data += WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr);
sizeof(struct wl3501_rx_hdr);
data += WL3501_BLKSZ -
sizeof(struct wl3501_rx_hdr);
} else {
wl3501_get_from_wla(this, this->start_seg +
sizeof(struct
wl3501_rx_hdr), data,
size);
size = 0;
}
} else { } else {
size -= 2; wl3501_get_from_wla(this,
*data = (size >> 8) & 0xff; this->start_seg +
*(data + 1) = size & 0xff; sizeof(struct wl3501_rx_hdr),
data += 2; data, size);
if (size > size = 0;
WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr) + 6) {
wl3501_get_from_wla(this,
this->start_seg +
offset_addr4, data,
WL3501_BLKSZ -
sizeof(struct wl3501_rx_hdr)
+ 6);
size -= WL3501_BLKSZ -
sizeof(struct wl3501_rx_hdr) + 6;
data += WL3501_BLKSZ -
sizeof(struct wl3501_rx_hdr) + 6;
} else {
wl3501_get_from_wla(this,
this->start_seg +
offset_addr4,
data, size);
size = 0;
}
} }
} else { } else {
if (size > WL3501_BLKSZ - offset_addr4) { size -= 2;
wl3501_get_from_wla(this, this->start_seg + *data = (size >> 8) & 0xff;
sizeof(struct wl3501_rx_hdr) + 6, *(data + 1) = size & 0xff;
data, WL3501_BLKSZ - offset_addr4); data += 2;
size -= WL3501_BLKSZ - offset_addr4; if (size >
data += WL3501_BLKSZ - offset_addr4; WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr) + 6) {
wl3501_get_from_wla(this,
this->start_seg + offset_addr4,
data,
WL3501_BLKSZ -
sizeof(struct wl3501_rx_hdr) + 6);
size -= WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr) + 6;
data += WL3501_BLKSZ - sizeof(struct wl3501_rx_hdr) + 6;
} else { } else {
wl3501_get_from_wla(this, this->start_seg + wl3501_get_from_wla(this,
sizeof(struct wl3501_rx_hdr) + 6, this->start_seg + offset_addr4,
data, size); data, size);
size = 0; size = 0;
} }
...@@ -956,7 +909,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev, ...@@ -956,7 +909,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev,
{ {
struct wl3501_md_ind sig; struct wl3501_md_ind sig;
struct sk_buff *skb; struct sk_buff *skb;
unsigned char rssi; unsigned char rssi, addr4[ETH_ALEN];
u16 pkt_len; u16 pkt_len;
wl3501_get_from_wla(this, addr, &sig, sizeof(sig)); wl3501_get_from_wla(this, addr, &sig, sizeof(sig));
...@@ -966,26 +919,21 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev, ...@@ -966,26 +919,21 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev,
&rssi, sizeof(rssi)); &rssi, sizeof(rssi));
this->rssi = rssi <= 63 ? (rssi * 100) / 64 : 255; this->rssi = rssi <= 63 ? (rssi * 100) / 64 : 255;
if (this->llc_type == 1) { wl3501_get_from_wla(this,
unsigned char addr4[ETH_ALEN]; sig.data +
offsetof(struct wl3501_rx_hdr, addr4),
wl3501_get_from_wla(this, &addr4, sizeof(addr4));
sig.data + if (addr4[0] == 0xAA && addr4[1] == 0xAA &&
offsetof(struct wl3501_rx_hdr, addr4), addr4[2] == 0x03 && addr4[4] == 0x00) {
&addr4, sizeof(addr4)); pkt_len = sig.size + 12 - 24 - 4 - 6;
if (addr4[0] == 0xAA && addr4[1] == 0xAA && this->ether_type = ARPHRD_ETHER;
addr4[2] == 0x03 && addr4[4] == 0x00) { } else if (addr4[0] == 0xE0 && addr4[1] == 0xE0) {
pkt_len = sig.size + 12 - 24 - 4 - 6; pkt_len = sig.size + 12 - 24 - 4 + 2;
this->ether_type = ARPHRD_ETHER; this->ether_type = ARPHRD_IEEE80211; /* FIXME */
} else if (addr4[0] == 0xE0 && addr4[1] == 0xE0) { } else {
pkt_len = sig.size + 12 - 24 - 4 + 2; pkt_len = sig.size + 12 - 24 - 4 + 2;
this->ether_type = ARPHRD_IEEE80211; /* FIXME */ this->ether_type = ARPHRD_IEEE80211; /* FIXME */
} else { }
pkt_len = sig.size + 12 - 24 - 4 + 2;
this->ether_type = ARPHRD_IEEE80211; /* FIXME */
}
} else
pkt_len = sig.size - 24 - 4;
skb = dev_alloc_skb(pkt_len + 5); skb = dev_alloc_skb(pkt_len + 5);
...@@ -995,8 +943,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev, ...@@ -995,8 +943,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev,
this->stats.rx_dropped++; this->stats.rx_dropped++;
} else { } else {
skb->dev = dev; skb->dev = dev;
skb_reserve(skb, 2); /* IP headers on 16 bytes skb_reserve(skb, 2); /* IP headers on 16 bytes boundaries */
boundaries */
eth_copy_and_sum(skb, (unsigned char *)&sig.daddr, 12, 0); eth_copy_and_sum(skb, (unsigned char *)&sig.daddr, 12, 0);
wl3501_receive(this, skb->data, pkt_len); wl3501_receive(this, skb->data, pkt_len);
skb_put(skb, pkt_len); skb_put(skb, pkt_len);
...@@ -2127,9 +2074,10 @@ static void wl3501_config(dev_link_t *link) ...@@ -2127,9 +2074,10 @@ static void wl3501_config(dev_link_t *link)
printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]); printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]);
} }
printk("\n"); printk("\n");
/* initialize card parameter - added by jss */ /*
* Initialize card parameters - added by jss
*/
this->net_type = IW_MODE_INFRA; this->net_type = IW_MODE_INFRA;
this->llc_type = 1;
this->bss_cnt = 0; this->bss_cnt = 0;
this->join_sta_bss = 0; this->join_sta_bss = 0;
this->adhoc_times = 0; this->adhoc_times = 0;
......
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