Commit 11e672c3 authored by Mateusz Kulikowski's avatar Mateusz Kulikowski Committed by Greg Kroah-Hartman

staging: rtl8192e: Replace RTLLIB_DEBUG(DL_ERR) with netdev_*()

Replace all RTLLIB_DEBUG(RTLLIB_DL_ERR, *) calls with netdev_err()
for errors that really should be reported to user.
Use netdev_warn() for the rest.
Rephrase some of the messages to make them more readable/compact.
Signed-off-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1af35de2
......@@ -88,12 +88,12 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst,
"========>%s(), frame(%d) sentd to: %pM, ieee->dev:%p\n",
__func__, type, Dst, ieee->dev);
if (pBA == NULL) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "pBA is NULL\n");
netdev_warn(ieee->dev, "pBA is NULL\n");
return NULL;
}
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
if (skb == NULL) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
netdev_err(ieee->dev, "Can't alloc skb for ADDBA_REQ\n");
return NULL;
}
......@@ -159,7 +159,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst,
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
if (skb == NULL) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
netdev_err(ieee->dev, "Can't alloc skb for DELBA_REQ\n");
return NULL;
}
......@@ -247,8 +247,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb)
struct rx_ts_record *pTS = NULL;
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 9) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
" Invalid skb len in BAREQ(%d / %d)\n",
netdev_warn(ieee->dev, "Invalid skb len in BAREQ(%d / %d)\n",
(int)skb->len,
(int)(sizeof(struct rtllib_hdr_3addr) + 9));
return -1;
......@@ -270,7 +269,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb)
(ieee->pHTInfo->bCurrentHTSupport == false) ||
(ieee->pHTInfo->IOTAction & HT_IOT_ACT_REJECT_ADDBA_REQ)) {
rc = ADDBA_STATUS_REFUSED;
RTLLIB_DEBUG(RTLLIB_DL_ERR,
netdev_warn(ieee->dev,
"Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n",
ieee->current_network.qos_data.active,
ieee->pHTInfo->bCurrentHTSupport);
......@@ -279,15 +278,15 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb)
if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst,
(u8)(pBaParamSet->field.TID), RX_DIR, true)) {
rc = ADDBA_STATUS_REFUSED;
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS in %s()\n", __func__);
netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__);
goto OnADDBAReq_Fail;
}
pBA = &pTS->RxAdmittedBARecord;
if (pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED) {
rc = ADDBA_STATUS_INVALID_PARAM;
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"BA Policy is not correct in %s()\n", __func__);
netdev_warn(ieee->dev, "%s(): BA Policy is not correct\n",
__func__);
goto OnADDBAReq_Fail;
}
......@@ -334,8 +333,7 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb)
u16 ReasonCode;
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 9) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"Invalid skb len in BARSP(%d / %d)\n",
netdev_warn(ieee->dev, "Invalid skb len in BARSP(%d / %d)\n",
(int)skb->len,
(int)(sizeof(struct rtllib_hdr_3addr) + 9));
return -1;
......@@ -353,7 +351,7 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb)
if (ieee->current_network.qos_data.active == 0 ||
ieee->pHTInfo->bCurrentHTSupport == false ||
ieee->pHTInfo->bCurrentAMPDUEnable == false) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
netdev_warn(ieee->dev,
"reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n",
ieee->current_network.qos_data.active,
ieee->pHTInfo->bCurrentHTSupport,
......@@ -365,7 +363,7 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb)
if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst,
(u8)(pBaParamSet->field.TID), TX_DIR, false)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS in %s()\n", __func__);
netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__);
ReasonCode = DELBA_REASON_UNKNOWN_BA;
goto OnADDBARsp_Reject;
}
......@@ -381,8 +379,9 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb)
return -1;
} else if ((pPendingBA->bValid == false) ||
(*pDialogToken != pPendingBA->DialogToken)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"OnADDBARsp(): Recv ADDBA Rsp. BA invalid, DELBA!\n");
netdev_warn(ieee->dev,
"%s(): Recv ADDBA Rsp. BA invalid, DELBA!\n",
__func__);
ReasonCode = DELBA_REASON_UNKNOWN_BA;
goto OnADDBARsp_Reject;
} else {
......@@ -435,8 +434,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
u8 *dst = NULL;
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 6) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"Invalid skb len in DELBA(%d / %d)\n",
netdev_warn(ieee->dev, "Invalid skb len in DELBA(%d / %d)\n",
(int)skb->len,
(int)(sizeof(struct rtllib_hdr_3addr) + 6));
return -1;
......@@ -444,7 +442,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
if (ieee->current_network.qos_data.active == 0 ||
ieee->pHTInfo->bCurrentHTSupport == false) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
netdev_warn(ieee->dev,
"received DELBA while QOS or HT is not supported(%d, %d)\n",
ieee->current_network. qos_data.active,
ieee->pHTInfo->bCurrentHTSupport);
......@@ -463,8 +461,8 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
if (!GetTs(ieee, (struct ts_common_info **)&pRxTs, dst,
(u8)pDelBaParamSet->field.TID, RX_DIR, false)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"can't get TS for RXTS in %s().dst: %pM TID:%d\n",
netdev_warn(ieee->dev,
"%s(): can't get TS for RXTS. dst:%pM TID:%d\n",
__func__, dst,
(u8)pDelBaParamSet->field.TID);
return -1;
......@@ -476,8 +474,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
if (!GetTs(ieee, (struct ts_common_info **)&pTxTs, dst,
(u8)pDelBaParamSet->field.TID, TX_DIR, false)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"can't get TS for TXTS in %s()\n",
netdev_warn(ieee->dev, "%s(): can't get TS for TXTS\n",
__func__);
return -1;
}
......
......@@ -291,8 +291,8 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap,
struct ht_capab_ele *pCapELE = NULL;
if ((posHTCap == NULL) || (pHT == NULL)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"posHTCap or pHTInfo can't be null in HTConstructCapabilityElement()\n");
netdev_warn(ieee->dev,
"%s(): posHTCap and pHTInfo are null\n", __func__);
return;
}
memset(posHTCap, 0, *len);
......@@ -373,8 +373,9 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo,
struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo;
if ((posHTInfo == NULL) || (pHTInfoEle == NULL)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"posHTInfo or pHTInfoEle can't be null in HTConstructInfoElement()\n");
netdev_warn(ieee->dev,
"%s(): posHTInfo and pHTInfoEle are null\n",
__func__);
return;
}
......@@ -413,8 +414,7 @@ void HTConstructRT2RTAggElement(struct rtllib_device *ieee, u8 *posRT2RTAgg,
u8 *len)
{
if (posRT2RTAgg == NULL) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"posRT2RTAgg can't be null in HTConstructRT2RTAggElement()\n");
netdev_warn(ieee->dev, "%s(): posRT2RTAgg is null\n", __func__);
return;
}
memset(posRT2RTAgg, 0, *len);
......@@ -437,8 +437,7 @@ static u8 HT_PickMCSRate(struct rtllib_device *ieee, u8 *pOperateMCS)
u8 i;
if (pOperateMCS == NULL) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"pOperateMCS can't be null in HT_PickMCSRate()\n");
netdev_warn(ieee->dev, "%s(): pOperateMCS is null\n", __func__);
return false;
}
......@@ -472,8 +471,9 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet,
u8 availableMcsRate[16];
if (pMCSRateSet == NULL || pMCSFilter == NULL) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"pMCSRateSet or pMCSFilter can't be null in HTGetHighestMCSRate()\n");
netdev_warn(ieee->dev,
"%s(): pMCSRateSet and pMCSFilter are null\n",
__func__);
return false;
}
for (i = 0; i < 16; i++)
......@@ -538,8 +538,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34};
if (pHTInfo->bCurrentHTSupport == false) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"<=== HTOnAssocRsp(): HT_DISABLE\n");
netdev_warn(ieee->dev, "%s(): HT_DISABLE\n", __func__);
return;
}
RTLLIB_DEBUG(RTLLIB_DL_HT, "===> HTOnAssocRsp_wq(): HT_ENABLE\n");
......
......@@ -78,8 +78,9 @@ static void RxPktPendingTimeout(unsigned long data)
pRxTs->RxTimeoutIndicateSeq = 0xffff;
if (index > REORDER_WIN_SIZE) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"RxReorderIndicatePacket(): Rx Reorder struct buffer full!!\n");
netdev_warn(ieee->dev,
"%s(): Rx Reorder struct buffer full\n",
__func__);
spin_unlock_irqrestore(&(ieee->reorder_spinlock),
flags);
return;
......@@ -318,16 +319,14 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
enum direction_value Dir;
if (is_multicast_ether_addr(Addr)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"ERR! get TS for Broadcast or Multicast\n");
netdev_warn(ieee->dev, "Get TS for Broadcast or Multicast\n");
return false;
}
if (ieee->current_network.qos_data.supported == 0) {
UP = 0;
} else {
if (!IsACValid(TID)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"ERR! in %s(), TID(%d) is not valid\n",
netdev_warn(ieee->dev, "%s(): TID(%d) is not valid\n",
__func__, TID);
return false;
}
......@@ -413,9 +412,9 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
return true;
}
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"ERR!!in function %s() There is not enough dir=%d(0=up down=1) TS record to be used!!",
__func__, Dir);
netdev_warn(ieee->dev,
"There is not enough dir=%d(0=up down=1) TS record to be used!",
Dir);
return false;
}
......
......@@ -654,7 +654,9 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
* indicate all the packets in struct buffer and get
* reorder entries.
*/
RTLLIB_DEBUG(RTLLIB_DL_ERR, "RxReorderIndicatePacket(): There is no reorder entry!! Packet is dropped!!\n");
netdev_err(ieee->dev,
"%s(): There is no reorder entry! Packet is dropped!\n",
__func__);
{
int i;
......@@ -676,7 +678,9 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) {
/* This protect struct buffer from overflow. */
if (index >= REORDER_WIN_SIZE) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "RxReorderIndicatePacket(): Buffer overflow!!\n");
netdev_err(ieee->dev,
"%s(): Buffer overflow!\n",
__func__);
bPktInBuf = true;
break;
}
......@@ -707,7 +711,9 @@ static void RxReorderIndicatePacket(struct rtllib_device *ieee,
pTS->RxTimeoutIndicateSeq = 0xffff;
if (index > REORDER_WIN_SIZE) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "RxReorderIndicatePacket(): Rx Reorder struct buffer full!!\n");
netdev_err(ieee->dev,
"%s(): Rx Reorder struct buffer full!\n",
__func__);
spin_unlock_irqrestore(&(ieee->reorder_spinlock),
flags);
return;
......@@ -911,7 +917,8 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
pRxTS->RxLastFragNum = frag;
pRxTS->RxLastSeqNum = WLAN_GET_SEQ_SEQ(sc);
} else {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR!!%s(): No TS!! Skip the check!!\n", __func__);
netdev_warn(ieee->dev, "%s(): No TS! Skip the check!\n",
__func__);
return -1;
}
}
......
......@@ -2200,8 +2200,8 @@ static void rtllib_process_action(struct rtllib_device *ieee, struct sk_buff *sk
u8 category = 0;
if (act == NULL) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"error to get payload of action frame\n");
netdev_warn(ieee->dev,
"Error getting payload of action frame\n");
return;
}
......@@ -3074,7 +3074,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
ieee->seq_ctrl[i] = 0;
ieee->pDot11dInfo = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC);
if (!ieee->pDot11dInfo)
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc memory for DOT11D\n");
netdev_err(ieee->dev, "Can't alloc memory for DOT11D\n");
ieee->LinkDetectInfo.SlotIndex = 0;
ieee->LinkDetectInfo.SlotNum = 2;
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0;
......
......@@ -575,8 +575,8 @@ int rtllib_wx_set_power(struct rtllib_device *ieee,
if ((!ieee->sta_wake_up) ||
(!ieee->enter_sleep_state) ||
(!ieee->ps_is_queue_empty)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"%s(): PS mode is tried to be use but driver missed a callback\n\n",
netdev_warn(ieee->dev,
"%s(): PS mode is tried to be use but driver missed a callback\n",
__func__);
return -1;
}
......
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