Lines 1143-1150
Link Here
|
1143 |
|
1143 |
|
1144 |
DBFENTER; |
1144 |
DBFENTER; |
1145 |
|
1145 |
|
1146 |
cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | |
1146 |
if (enable == HFA384x_MONITOR_ENABLE) { |
1147 |
HFA384x_CMD_AINFO_SET(enable); |
1147 |
// KoreK: get into test mode 0x0a |
|
|
1148 |
cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | |
1149 |
HFA384x_CMD_AINFO_SET(0x0a); |
1150 |
} else { |
1151 |
cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | |
1152 |
HFA384x_CMD_AINFO_SET(enable); |
1153 |
} |
1148 |
cmd.parm0 = 0; |
1154 |
cmd.parm0 = 0; |
1149 |
cmd.parm1 = 0; |
1155 |
cmd.parm1 = 0; |
1150 |
cmd.parm2 = 0; |
1156 |
cmd.parm2 = 0; |
Lines 3258-3294
Link Here
|
3258 |
HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | |
3264 |
HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | |
3259 |
HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0); |
3265 |
HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0); |
3260 |
#endif |
3266 |
#endif |
3261 |
hw->txbuff.txfrm.desc.tx_control = |
|
|
3262 |
host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control); |
3263 |
|
3267 |
|
3264 |
/* copy the header over to the txdesc */ |
3268 |
if (skb->protocol != htons(ETH_P_80211_RAW)) { |
3265 |
memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t)); |
3269 |
hw->txbuff.txfrm.desc.tx_control = |
|
|
3270 |
host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control); |
3271 |
|
3272 |
/* copy the header over to the txdesc */ |
3273 |
memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, |
3274 |
sizeof(p80211_hdr_t)); |
3275 |
|
3276 |
/* if we're using host WEP, increase size by IV+ICV */ |
3277 |
if (p80211_wep->data) { |
3278 |
hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8); |
3279 |
// hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); |
3280 |
usbpktlen+=8; |
3281 |
} else { |
3282 |
hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len); |
3283 |
} |
3284 |
} else { |
3285 |
/* KoreK: raw injection (monitor mode): pull the rest of |
3286 |
the header and ssanity check on txdesc.data_len */ |
3287 |
memcpy(&(hw->txbuff.txfrm.desc.data_len), skb->data, 16); |
3288 |
skb_pull(skb,16); |
3289 |
if (hw->txbuff.txfrm.desc.data_len != host2hfa384x_16(skb->len)) { |
3290 |
printk(KERN_DEBUG "mismatch frame_len, drop frame\n"); |
3291 |
return 0; |
3292 |
} |
3266 |
|
3293 |
|
3267 |
/* if we're using host WEP, increase size by IV+ICV */ |
3294 |
hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1); |
3268 |
if (p80211_wep->data) { |
3295 |
hw->txbuff.txfrm.desc.tx_control = |
3269 |
hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8); |
3296 |
host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control); |
3270 |
// hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); |
3297 |
|
3271 |
usbpktlen+=8; |
3298 |
/* copy the header over to the txdesc */ |
3272 |
} else { |
3299 |
memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, |
3273 |
hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len); |
3300 |
sizeof(p80211_hdr_t)); |
3274 |
} |
3301 |
} |
3275 |
|
3302 |
|
3276 |
usbpktlen += skb->len; |
3303 |
usbpktlen += skb->len; |
3277 |
|
3304 |
|
3278 |
/* copy over the WEP IV if we are using host WEP */ |
3305 |
/* copy over the WEP IV if we are using host WEP */ |
3279 |
ptr = hw->txbuff.txfrm.data; |
3306 |
ptr = hw->txbuff.txfrm.data; |
3280 |
if (p80211_wep->data) { |
3307 |
if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) { |
3281 |
memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv)); |
3308 |
memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv)); |
3282 |
ptr+= sizeof(p80211_wep->iv); |
3309 |
ptr+= sizeof(p80211_wep->iv); |
3283 |
memcpy(ptr, p80211_wep->data, skb->len); |
3310 |
memcpy(ptr, p80211_wep->data, skb->len); |
3284 |
} else { |
3311 |
} else { |
3285 |
memcpy(ptr, skb->data, skb->len); |
3312 |
memcpy(ptr, skb->data, skb->len); |
3286 |
} |
3313 |
} |
|
|
3314 |
|
3287 |
/* copy over the packet data */ |
3315 |
/* copy over the packet data */ |
3288 |
ptr+= skb->len; |
3316 |
ptr+= skb->len; |
3289 |
|
3317 |
|
3290 |
/* copy over the WEP ICV if we are using host WEP */ |
3318 |
/* copy over the WEP ICV if we are using host WEP */ |
3291 |
if (p80211_wep->data) { |
3319 |
if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) { |
3292 |
memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv)); |
3320 |
memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv)); |
3293 |
} |
3321 |
} |
3294 |
|
3322 |
|
Lines 4105-4110
Link Here
|
4105 |
switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status)) |
4133 |
switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status)) |
4106 |
{ |
4134 |
{ |
4107 |
case 0: |
4135 |
case 0: |
|
|
4136 |
/* KoreK: this testmode uses macport 0 */ |
4137 |
if ((wlandev->netdev->type == ARPHRD_IEEE80211) || |
4138 |
(wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) { |
4139 |
if ( ! HFA384x_RXSTATUS_ISFCSERR(usbin->rxfrm.desc.status) ) { |
4140 |
hfa384x_int_rxmonitor(wlandev, &usbin->rxfrm); |
4141 |
} else { |
4142 |
WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n"); |
4143 |
} |
4144 |
goto done; |
4145 |
} |
4146 |
|
4108 |
w_hdr = (p80211_hdr_t *) &(usbin->rxfrm.desc.frame_control); |
4147 |
w_hdr = (p80211_hdr_t *) &(usbin->rxfrm.desc.frame_control); |
4109 |
fc = ieee2host16(usbin->rxfrm.desc.frame_control); |
4148 |
fc = ieee2host16(usbin->rxfrm.desc.frame_control); |
4110 |
|
4149 |
|