|
@@ -1578,7 +1578,7 @@ static void rtl8180_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
|
|
{
|
|
{
|
|
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
|
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
|
int mode;
|
|
int mode;
|
|
- struct ieee80211_hdr_3addr *h = (struct ieee80211_hdr_3addr *) skb->data;
|
|
|
|
|
|
+ struct ieee80211_hdr_3addr *h = (struct ieee80211_hdr_3addr *)skb->data;
|
|
short morefrag = (h->frame_control) & IEEE80211_FCTL_MOREFRAGS;
|
|
short morefrag = (h->frame_control) & IEEE80211_FCTL_MOREFRAGS;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
int priority;
|
|
int priority;
|
|
@@ -1659,7 +1659,10 @@ static void rtl8180_prepare_beacon(struct net_device *dev)
|
|
|
|
|
|
u16 word = read_nic_word(dev, BcnItv);
|
|
u16 word = read_nic_word(dev, BcnItv);
|
|
word &= ~BcnItv_BcnItv; /* clear Bcn_Itv */
|
|
word &= ~BcnItv_BcnItv; /* clear Bcn_Itv */
|
|
- word |= cpu_to_le16(priv->ieee80211->current_network.beacon_interval); /* 0x64; */
|
|
|
|
|
|
+
|
|
|
|
+ /* word |= 0x64; */
|
|
|
|
+ word |= cpu_to_le16(priv->ieee80211->current_network.beacon_interval);
|
|
|
|
+
|
|
write_nic_word(dev, BcnItv, word);
|
|
write_nic_word(dev, BcnItv, word);
|
|
|
|
|
|
skb = ieee80211_get_beacon(priv->ieee80211);
|
|
skb = ieee80211_get_beacon(priv->ieee80211);
|
|
@@ -1687,16 +1690,17 @@ short rtl8180_tx(struct net_device *dev, u8 *txbuf, int len, int priority,
|
|
int buflen;
|
|
int buflen;
|
|
int count;
|
|
int count;
|
|
struct buffer *buflist;
|
|
struct buffer *buflist;
|
|
- struct ieee80211_hdr_3addr *frag_hdr = (struct ieee80211_hdr_3addr *)txbuf;
|
|
|
|
|
|
+ struct ieee80211_hdr_3addr *frag_hdr =
|
|
|
|
+ (struct ieee80211_hdr_3addr *)txbuf;
|
|
u8 dest[ETH_ALEN];
|
|
u8 dest[ETH_ALEN];
|
|
- u8 bUseShortPreamble = 0;
|
|
|
|
- u8 bCTSEnable = 0;
|
|
|
|
- u8 bRTSEnable = 0;
|
|
|
|
- u16 Duration = 0;
|
|
|
|
- u16 RtsDur = 0;
|
|
|
|
- u16 ThisFrameTime = 0;
|
|
|
|
- u16 TxDescDuration = 0;
|
|
|
|
- bool ownbit_flag = false;
|
|
|
|
|
|
+ u8 bUseShortPreamble = 0;
|
|
|
|
+ u8 bCTSEnable = 0;
|
|
|
|
+ u8 bRTSEnable = 0;
|
|
|
|
+ u16 Duration = 0;
|
|
|
|
+ u16 RtsDur = 0;
|
|
|
|
+ u16 ThisFrameTime = 0;
|
|
|
|
+ u16 TxDescDuration = 0;
|
|
|
|
+ bool ownbit_flag = false;
|
|
|
|
|
|
switch (priority) {
|
|
switch (priority) {
|
|
case MANAGE_PRIORITY:
|
|
case MANAGE_PRIORITY:
|
|
@@ -1822,7 +1826,8 @@ short rtl8180_tx(struct net_device *dev, u8 *txbuf, int len, int priority,
|
|
while (remain != 0) {
|
|
while (remain != 0) {
|
|
mb();
|
|
mb();
|
|
if (!buflist) {
|
|
if (!buflist) {
|
|
- DMESGE("TX buffer error, cannot TX frames. pri %d.", priority);
|
|
|
|
|
|
+ DMESGE("TX buffer error, cannot TX frames. pri %d.",
|
|
|
|
+ priority);
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
buf = buflist->buf;
|
|
buf = buflist->buf;
|
|
@@ -1841,43 +1846,54 @@ short rtl8180_tx(struct net_device *dev, u8 *txbuf, int len, int priority,
|
|
*(tail+6) = 0;
|
|
*(tail+6) = 0;
|
|
*(tail+7) = 0;
|
|
*(tail+7) = 0;
|
|
|
|
|
|
- /* FIXME: this should be triggered by HW encryption parameters.*/
|
|
|
|
|
|
+ /* FIXME: should be triggered by HW encryption parameters.*/
|
|
*tail |= (1<<15); /* no encrypt */
|
|
*tail |= (1<<15); /* no encrypt */
|
|
|
|
|
|
if (remain == len && !descfrag) {
|
|
if (remain == len && !descfrag) {
|
|
ownbit_flag = false;
|
|
ownbit_flag = false;
|
|
- *tail = *tail | (1<<29); /* fist segment of the packet */
|
|
|
|
|
|
+ *tail = *tail | (1 << 29); /* first segment of packet */
|
|
*tail = *tail | (len);
|
|
*tail = *tail | (len);
|
|
} else {
|
|
} else {
|
|
ownbit_flag = true;
|
|
ownbit_flag = true;
|
|
}
|
|
}
|
|
|
|
|
|
for (i = 0; i < buflen && remain > 0; i++, remain--) {
|
|
for (i = 0; i < buflen && remain > 0; i++, remain--) {
|
|
- ((u8 *)buf)[i] = txbuf[i]; /* copy data into descriptor pointed DMAble buffer */
|
|
|
|
|
|
+ /* copy data into descriptor pointed DMAble buffer */
|
|
|
|
+ ((u8 *)buf)[i] = txbuf[i];
|
|
|
|
+
|
|
if (remain == 4 && i+4 >= buflen)
|
|
if (remain == 4 && i+4 >= buflen)
|
|
break;
|
|
break;
|
|
/* ensure the last desc has at least 4 bytes payload */
|
|
/* ensure the last desc has at least 4 bytes payload */
|
|
-
|
|
|
|
}
|
|
}
|
|
txbuf = txbuf + i;
|
|
txbuf = txbuf + i;
|
|
*(tail+3) = *(tail+3) & ~0xfff;
|
|
*(tail+3) = *(tail+3) & ~0xfff;
|
|
*(tail+3) = *(tail+3) | i; /* buffer length */
|
|
*(tail+3) = *(tail+3) | i; /* buffer length */
|
|
- /* Use short preamble or not */
|
|
|
|
- if (priv->ieee80211->current_network.capability&WLAN_CAPABILITY_SHORT_PREAMBLE)
|
|
|
|
- if (priv->plcp_preamble_mode == 1 && rate != 0) /* short mode now, not long! */
|
|
|
|
- ; /* *tail |= (1<<16); */ /* enable short preamble mode. */
|
|
|
|
|
|
+
|
|
|
|
+ /* Use short preamble or not - if true, enable short preamble */
|
|
|
|
+ /*
|
|
|
|
+ if (priv->ieee80211->current_network.capability &
|
|
|
|
+ WLAN_CAPABILITY_SHORT_PREAMBLE &&
|
|
|
|
+ priv->plcp_preamble_mode == 1 && rate != 0) {
|
|
|
|
+ *tail |= (1 << 16);
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
|
|
if (bCTSEnable)
|
|
if (bCTSEnable)
|
|
*tail |= (1<<18);
|
|
*tail |= (1<<18);
|
|
|
|
|
|
if (bRTSEnable) { /* rts enable */
|
|
if (bRTSEnable) { /* rts enable */
|
|
- *tail |= ((ieeerate2rtlrate(priv->ieee80211->basic_rate))<<19); /* RTS RATE */
|
|
|
|
|
|
+ /* RTS RATE */
|
|
|
|
+ *tail |= (ieeerate2rtlrate(
|
|
|
|
+ priv->ieee80211->basic_rate) << 19);
|
|
|
|
+
|
|
*tail |= (1<<23); /* rts enable */
|
|
*tail |= (1<<23); /* rts enable */
|
|
*(tail+1) |= (RtsDur&0xffff); /* RTS Duration */
|
|
*(tail+1) |= (RtsDur&0xffff); /* RTS Duration */
|
|
}
|
|
}
|
|
*(tail+3) |= ((TxDescDuration&0xffff)<<16); /* DURATION */
|
|
*(tail+3) |= ((TxDescDuration&0xffff)<<16); /* DURATION */
|
|
/* *(tail+3) |= (0xe6<<16); */
|
|
/* *(tail+3) |= (0xe6<<16); */
|
|
- *(tail+5) |= (11<<8); /* (priv->retry_data<<8); */ /* retry lim; */
|
|
|
|
|
|
+
|
|
|
|
+ /* (priv->retry_data<<8); */
|
|
|
|
+ *(tail + 5) |= (11 << 8); /* retry lim; */
|
|
|
|
|
|
*tail = *tail | ((rate&0xf) << 24);
|
|
*tail = *tail | ((rate&0xf) << 24);
|
|
|
|
|
|
@@ -1891,7 +1907,8 @@ short rtl8180_tx(struct net_device *dev, u8 *txbuf, int len, int priority,
|
|
|
|
|
|
wmb();
|
|
wmb();
|
|
if (ownbit_flag)
|
|
if (ownbit_flag)
|
|
- *tail = *tail | (1<<31); /* descriptor ready to be txed */
|
|
|
|
|
|
+ /* descriptor ready to be txed */
|
|
|
|
+ *tail |= (1 << 31);
|
|
|
|
|
|
if ((tail - begin)/8 == count-1)
|
|
if ((tail - begin)/8 == count-1)
|
|
tail = begin;
|
|
tail = begin;
|