Fixed copy_XXX_bap() return value. If there's an offset register
indicated error, now return the value of the offset register. Also changed All the bap error LOG_DEBUG()s in prism2sta.c to print the result in hex.
This commit is contained in:
parent
2a0a52f1b7
commit
b0eb144b91
|
@ -1151,10 +1151,10 @@ int hfa384x_copy_from_bap(hfa384x_t *hw, UINT16 bap, UINT16 id, UINT16 offset,
|
|||
} while ( i < 50 && HFA384x_OFFSET_ISBUSY(reg));
|
||||
if ( HFA384x_OFFSET_ISBUSY(reg) ){
|
||||
/* If timeout, return -ETIMEDOUT */
|
||||
result = -ETIMEDOUT;
|
||||
result = reg;
|
||||
} else if ( HFA384x_OFFSET_ISERR(reg) ){
|
||||
/* If offset[err] == 1, return -EINVAL */
|
||||
result = -EINVAL;
|
||||
result = reg;
|
||||
} else {
|
||||
/* Read even(len) buf contents from data reg */
|
||||
for ( i = 0; i < (len & 0xfffe); i+=2 ) {
|
||||
|
@ -1249,10 +1249,10 @@ int hfa384x_copy_to_bap(hfa384x_t *hw, UINT16 bap, UINT16 id, UINT16 offset,
|
|||
} while ( i < 50 && HFA384x_OFFSET_ISBUSY(reg));
|
||||
if ( HFA384x_OFFSET_ISBUSY(reg) ){
|
||||
/* If timeout, return -ETIMEDOUT */
|
||||
result = -ETIMEDOUT;
|
||||
result = reg;
|
||||
} else if ( HFA384x_OFFSET_ISERR(reg) ){
|
||||
/* If offset[err] == 1, return -EINVAL */
|
||||
result = -EINVAL;
|
||||
result = reg;
|
||||
} else {
|
||||
/* Write even(len) buf contents to data reg */
|
||||
for ( i = 0; i < (len & 0xfffe); i+=2 ) {
|
||||
|
@ -1271,7 +1271,7 @@ int hfa384x_copy_to_bap(hfa384x_t *hw, UINT16 bap, UINT16 id, UINT16 offset,
|
|||
} while ( i < 50 && HFA384x_OFFSET_ISBUSY(reg));
|
||||
if ( HFA384x_OFFSET_ISBUSY(reg) ){
|
||||
/* If timeout, return -ETIMEDOUT */
|
||||
result = -ETIMEDOUT;
|
||||
result = reg;
|
||||
} else {
|
||||
((UINT8*)(&savereg))[0] = d[len-1];
|
||||
outw( savereg, datareg);
|
||||
|
|
|
@ -389,7 +389,7 @@ dmpmem(&txdesc, sizeof(txdesc));
|
|||
&txdesc,
|
||||
sizeof(txdesc));
|
||||
if ( result ) {
|
||||
WLAN_LOG_DEBUG3(1, "copy_to_bap(%04x, 0, %d) failed, result=%d\n",
|
||||
WLAN_LOG_DEBUG3(1, "copy_to_bap(%04x, 0, %d) failed, result=0x%x\n",
|
||||
priv->txfid,
|
||||
sizeof(txdesc),
|
||||
result);
|
||||
|
@ -412,7 +412,7 @@ dmpmem(pb->p80211buf + WLAN_HDR_A3_LEN, pb->p80211buflen - WLAN_HDR_A3_LEN);
|
|||
pb->p80211buflen - WLAN_HDR_A3_LEN);
|
||||
if ( result ) {
|
||||
WLAN_LOG_DEBUG4(1,
|
||||
"copy_to_bap(%04x, %d, %d) failed, result=%d\n",
|
||||
"copy_to_bap(%04x, %d, %d) failed, result=0x%x\n",
|
||||
priv->txfid,
|
||||
pb->p80211buflen - WLAN_HDR_A3_LEN,
|
||||
sizeof(txdesc),
|
||||
|
@ -436,7 +436,7 @@ dmpmem(pb->p80211_payload, pb->p80211_payloadlen);
|
|||
|
||||
if ( result ) {
|
||||
WLAN_LOG_DEBUG4(1,
|
||||
"copy_to_bap(%04x, %d, %d) failed, result=%d\n",
|
||||
"copy_to_bap(%04x, %d, %d) failed, result=0x%x\n",
|
||||
priv->txfid,
|
||||
sizeof(txdesc) + pb->p80211buflen - WLAN_HDR_A3_LEN,
|
||||
pb->p80211_payloadlen,
|
||||
|
@ -616,7 +616,8 @@ int prism2sta_initmac(wlandevice_t *wlandev)
|
|||
priv->txfid = hfa384x2host_16(priv->txfid);
|
||||
reg = host2hfa384x_16(HFA384x_EVACK_ALLOC_SET(1));
|
||||
outw( reg, HFA384x_EVSTAT(hw->iobase));
|
||||
|
||||
WLAN_LOG_DEBUG1(1,"priv->txfid=0x%04x\n", priv->txfid);
|
||||
|
||||
/* Now, the info frame fid */
|
||||
result = hfa384x_cmd_allocate(hw, PRISM2_INFOBUF_MAX);
|
||||
if (result != 0) goto failed;
|
||||
|
@ -634,6 +635,7 @@ int prism2sta_initmac(wlandevice_t *wlandev)
|
|||
priv->infofid = hfa384x2host_16(priv->infofid);
|
||||
reg = host2hfa384x_16(HFA384x_EVACK_ALLOC_SET(1));
|
||||
outw( reg, HFA384x_EVSTAT(hw->iobase));
|
||||
WLAN_LOG_DEBUG1(1,"priv->infofid=0x%04x\n", priv->infofid);
|
||||
|
||||
/* Collect version and compatibility info */
|
||||
/* Some are critical, some are not */
|
||||
|
@ -1240,7 +1242,7 @@ void prism2sta_int_info(wlandevice_t *wlandev)
|
|||
hw->bap, reg, 0, &inf, sizeof(inf));
|
||||
if ( result ) {
|
||||
WLAN_LOG_DEBUG3(1,
|
||||
"copy_from_bap(0x%04x, 0, %d) failed, result=%d\n",
|
||||
"copy_from_bap(0x%04x, 0, %d) failed, result=0x%x\n",
|
||||
reg, sizeof(inf), result);
|
||||
goto failed;
|
||||
}
|
||||
|
@ -1252,7 +1254,7 @@ void prism2sta_int_info(wlandevice_t *wlandev)
|
|||
hw->bap, reg, 0, buf, 2 + (inf.framelen * 2));
|
||||
if ( result ) {
|
||||
WLAN_LOG_DEBUG3(1,
|
||||
"copy_from_bap(0x%04x, 0, %d) failed, result=%d\n",
|
||||
"copy_from_bap(0x%04x, 0, %d) failed, result=0x%x\n",
|
||||
reg, sizeof(inf), result);
|
||||
goto failed;
|
||||
}
|
||||
|
@ -1314,7 +1316,7 @@ void prism2sta_int_txexc(wlandevice_t *wlandev)
|
|||
result = hfa384x_copy_from_bap(hw, hw->bap, fid, 0, &status, sizeof(status));
|
||||
if ( result ) {
|
||||
WLAN_LOG_DEBUG3(1,
|
||||
"copy_from_bap(0x%04x, 0, %d) failed, result=%d\n",
|
||||
"copy_from_bap(0x%04x, 0, %d) failed, result=0x%x\n",
|
||||
fid, sizeof(status), result);
|
||||
goto failed;
|
||||
}
|
||||
|
@ -1395,7 +1397,7 @@ void prism2sta_int_rx(wlandevice_t *wlandev)
|
|||
sizeof(rxdesc));
|
||||
if ( result ) {
|
||||
WLAN_LOG_DEBUG4(1,
|
||||
"copy_from_bap(0x%04x, %d, %d) failed, result=%d\n",
|
||||
"copy_from_bap(0x%04x, %d, %d) failed, result=0x%x\n",
|
||||
rxfid,
|
||||
0,
|
||||
sizeof(rxdesc),
|
||||
|
@ -1434,7 +1436,7 @@ printk("\n");
|
|||
HFA384x_RX_80211HDR_OFF, pb->p80211_hdr, WLAN_HDR_A3_LEN);
|
||||
if ( result ) {
|
||||
WLAN_LOG_DEBUG4(1,
|
||||
"copy_from_bap(0x%04x, %d, %d) failed, result=%d\n",
|
||||
"copy_from_bap(0x%04x, %d, %d) failed, result=0x%x\n",
|
||||
rxfid,
|
||||
HFA384x_RX_80211HDR_OFF,
|
||||
WLAN_HDR_A3_LEN,
|
||||
|
@ -1450,7 +1452,7 @@ printk("\n");
|
|||
pb->p80211_payload, rxdesc.data_len);
|
||||
if ( result ) {
|
||||
WLAN_LOG_DEBUG4(1,
|
||||
"copy_from_bap(0x%04x, %d, %d) failed, result=%d\n",
|
||||
"copy_from_bap(0x%04x, %d, %d) failed, result=0x%x\n",
|
||||
rxfid,
|
||||
HFA384x_RX_DATA_OFF,
|
||||
rxdesc.data_len,
|
||||
|
|
Loading…
Reference in New Issue