dect
/
linux-2.6
Archived
13
0
Fork 0

staging: rt2860: change plain format of mac address to %pM in *printf()

There are many locations where MAC or BSSID is printed. The plain format
is used in such places. *printf() in kernel recognizes
%pM, %pMF and %pm format parameters to print out 6-byte array as MAC
address. This patch changes plain format to custom %pM which is widely
used in kernel.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Andy Shevchenko 2010-09-11 17:17:04 +03:00 committed by Greg Kroah-Hartman
parent ef6c3c6e53
commit aa4d282cba
12 changed files with 30 additions and 67 deletions

View File

@ -654,8 +654,8 @@ BOOLEAN BARecSessionAdd(struct rt_rtmp_adapter *pAd,
} else {
Status = FALSE;
DBGPRINT(RT_DEBUG_TRACE,
("Can't Accept ADDBA for %02x:%02x:%02x:%02x:%02x:%02x TID = %d\n",
PRINT_MAC(pEntry->Addr), TID));
("Can't Accept ADDBA for %pM TID = %d\n",
&pEntry->Addr[0], TID));
}
return (Status);
}

View File

@ -663,10 +663,7 @@ int RTUSBWriteHWMACAddress(struct rt_rtmp_adapter *pAd)
StaMacReg1.field.Byte5 = pAd->CurrentAddress[5];
StaMacReg1.field.U2MeMask = 0xff;
DBGPRINT_RAW(RT_DEBUG_TRACE,
("Local MAC = %02x:%02x:%02x:%02x:%02x:%02x\n",
pAd->CurrentAddress[0], pAd->CurrentAddress[1],
pAd->CurrentAddress[2], pAd->CurrentAddress[3],
pAd->CurrentAddress[4], pAd->CurrentAddress[5]));
("Local MAC = %pM\n", &pAd->CurrentAddress[0]));
RTUSBWriteMACRegister(pAd, MAC_ADDR_DW0, StaMacReg0.word);
RTUSBWriteMACRegister(pAd, MAC_ADDR_DW1, StaMacReg1.word);

View File

@ -221,8 +221,8 @@ void WpaEAPOLKeyAction(struct rt_rtmp_adapter *pAd, struct rt_mlme_queue_elem *E
break;
DBGPRINT(RT_DEBUG_TRACE,
("Receive EAPoL-Key frame from STA %02X-%02X-%02X-%02X-%02X-%02X\n",
PRINT_MAC(pEntry->Addr)));
("Receive EAPoL-Key frame from STA %pMF\n",
&pEntry->Addr[0]));
if (((pEapol_packet->ProVer != EAPOL_VER)
&& (pEapol_packet->ProVer != EAPOL_VER2))

View File

@ -1536,10 +1536,9 @@ void MlmeAutoReconnectLastSSID(struct rt_rtmp_adapter *pAd)
{
if (pAd->StaCfg.bAutoConnectByBssid) {
DBGPRINT(RT_DEBUG_TRACE,
("Driver auto reconnect to last OID_802_11_BSSID setting - %02X:%02X:%02X:%02X:%02X:%02X\n",
pAd->MlmeAux.Bssid[0], pAd->MlmeAux.Bssid[1],
pAd->MlmeAux.Bssid[2], pAd->MlmeAux.Bssid[3],
pAd->MlmeAux.Bssid[4], pAd->MlmeAux.Bssid[5]));
("Driver auto reconnect to last OID_802_11_BSSID "
"setting - %pM\n",
&pAd->MlmeAux.Bssid[0]));
pAd->MlmeAux.Channel = pAd->CommonCfg.Channel;
MlmeEnqueue(pAd,

View File

@ -749,13 +749,7 @@ void NICReadEEPROMParameters(struct rt_rtmp_adapter *pAd, u8 *mac_addr)
/* pAd->PermanentAddress[5] = RandomByte(pAd)&0xf8; */
DBGPRINT_RAW(RT_DEBUG_TRACE,
("E2PROM MAC: =%02x:%02x:%02x:%02x:%02x:%02x\n",
pAd->PermanentAddress[0],
pAd->PermanentAddress[1],
pAd->PermanentAddress[2],
pAd->PermanentAddress[3],
pAd->PermanentAddress[4],
pAd->PermanentAddress[5]));
("E2PROM MAC: =%pM\n", &pAd->PermanentAddress[0]));
if (pAd->bLocalAdminMAC == FALSE) {
MAC_DW0_STRUC csr2;
MAC_DW1_STRUC csr3;
@ -772,8 +766,8 @@ void NICReadEEPROMParameters(struct rt_rtmp_adapter *pAd, u8 *mac_addr)
csr3.field.U2MeMask = 0xff;
RTMP_IO_WRITE32(pAd, MAC_ADDR_DW1, csr3.word);
DBGPRINT_RAW(RT_DEBUG_TRACE,
("E2PROM MAC: =%02x:%02x:%02x:%02x:%02x:%02x\n",
PRINT_MAC(pAd->PermanentAddress)));
("E2PROM MAC: =%pM\n",
&pAd->PermanentAddress[0]));
}
}

View File

@ -682,9 +682,7 @@ void RTMPSendWirelessEvent(struct rt_rtmp_adapter *pAd,
if (pAddr)
pBufPtr +=
sprintf(pBufPtr,
"(RT2860) STA(%02x:%02x:%02x:%02x:%02x:%02x) ",
PRINT_MAC(pAddr));
sprintf(pBufPtr, "(RT2860) STA(%pM) ", pAddr);
else if (BssIdx < MAX_MBSSID_NUM)
pBufPtr +=
sprintf(pBufPtr, "(RT2860) BSS(wlan%d) ", BssIdx);

View File

@ -409,9 +409,6 @@ struct os_cookie {
/***********************************************************************************
* OS debugging and printing related definitions and data structure
***********************************************************************************/
#define PRINT_MAC(addr) \
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
#ifdef DBG
extern unsigned long RTDebugLevel;

View File

@ -794,11 +794,8 @@ void MlmeDisassocReqAction(struct rt_rtmp_adapter *pAd, struct rt_mlme_queue_ele
RTMPCancelTimer(&pAd->MlmeAux.DisassocTimer, &TimerCancelled);
DBGPRINT(RT_DEBUG_TRACE,
("ASSOC - Send DISASSOC request[BSSID::%02x:%02x:%02x:%02x:%02x:%02x (Reason=%d)\n",
pDisassocReq->Addr[0], pDisassocReq->Addr[1],
pDisassocReq->Addr[2], pDisassocReq->Addr[3],
pDisassocReq->Addr[4], pDisassocReq->Addr[5],
pDisassocReq->Reason));
("ASSOC - Send DISASSOC request[BSSID::%pM (Reason=%d)\n",
&pDisassocReq->Addr[0], pDisassocReq->Reason));
MgtMacHeaderInit(pAd, &DisassocHdr, SUBTYPE_DISASSOC, 0, pDisassocReq->Addr, pDisassocReq->Addr); /* patch peap ttls switching issue */
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(struct rt_header_802_11), &DisassocHdr,

View File

@ -653,10 +653,8 @@ void CntlOidRTBssidProc(struct rt_rtmp_adapter *pAd, struct rt_mlme_queue_elem *
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, 0);
} */
/* No active association, join the BSS immediately */
DBGPRINT(RT_DEBUG_TRACE,
("CNTL - joining %02x:%02x:%02x:%02x:%02x:%02x ...\n",
pOidBssid[0], pOidBssid[1], pOidBssid[2],
pOidBssid[3], pOidBssid[4], pOidBssid[5]));
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - joining %pM ...\n",
&pOidBssid[0]));
JoinParmFill(pAd, &JoinReq, pAd->MlmeAux.BssIdx);
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_JOIN_REQ,
@ -778,13 +776,8 @@ void CntlWaitJoinProc(struct rt_rtmp_adapter *pAd, struct rt_mlme_queue_elem *El
LinkUp(pAd, BSS_ADHOC);
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
DBGPRINT(RT_DEBUG_TRACE,
("CNTL - join the IBSS = %02x:%02x:%02x:%02x:%02x:%02x ...\n",
pAd->CommonCfg.Bssid[0],
pAd->CommonCfg.Bssid[1],
pAd->CommonCfg.Bssid[2],
pAd->CommonCfg.Bssid[3],
pAd->CommonCfg.Bssid[4],
pAd->CommonCfg.Bssid[5]));
("CNTL - join the IBSS = %pM ...\n",
&pAd->CommonCfg.Bssid[0]));
pAd->IndicateMediaState =
NdisMediaStateConnected;
@ -902,13 +895,8 @@ void CntlWaitStartProc(struct rt_rtmp_adapter *pAd, struct rt_mlme_queue_elem *E
}
DBGPRINT(RT_DEBUG_TRACE,
("CNTL - start a new IBSS = %02x:%02x:%02x:%02x:%02x:%02x ...\n",
pAd->CommonCfg.Bssid[0],
pAd->CommonCfg.Bssid[1],
pAd->CommonCfg.Bssid[2],
pAd->CommonCfg.Bssid[3],
pAd->CommonCfg.Bssid[4],
pAd->CommonCfg.Bssid[5]));
("CNTL - start a new IBSS = %pM ...\n",
&pAd->CommonCfg.Bssid[0]));
} else {
DBGPRINT(RT_DEBUG_TRACE,
("CNTL - Start IBSS fail. BUG!\n"));

View File

@ -976,8 +976,8 @@ int STASendPacket(struct rt_rtmp_adapter *pAd, void *pPacket)
if (!pEntry) {
DBGPRINT(RT_DEBUG_ERROR,
("STASendPacket->Cannot find pEntry(%2x:%2x:%2x:%2x:%2x:%2x) in MacTab!\n",
PRINT_MAC(pSrcBufVA)));
("STASendPacket->Cannot find pEntry(%pM) in MacTab!\n",
pSrcBufVA));
/* Resourece is low, system did not allocate virtual address */
/* return NDIS_STATUS_FAILURE directly to upper layer */
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);

View File

@ -424,9 +424,8 @@ void MlmeJoinReqAction(struct rt_rtmp_adapter *pAd, struct rt_mlme_queue_elem *E
} while (FALSE);
DBGPRINT(RT_DEBUG_TRACE,
("SYNC - Switch to ch %d, Wait BEACON from %02x:%02x:%02x:%02x:%02x:%02x\n",
pBss->Channel, pBss->Bssid[0], pBss->Bssid[1], pBss->Bssid[2],
pBss->Bssid[3], pBss->Bssid[4], pBss->Bssid[5]));
("SYNC - Switch to ch %d, Wait BEACON from %pM\n",
pBss->Channel, &pBss->Bssid[0]));
pAd->Mlme.SyncMachine.CurrState = JOIN_WAIT_BEACON;
}
@ -1225,10 +1224,9 @@ void PeerBeacon(struct rt_rtmp_adapter *pAd, struct rt_mlme_queue_elem *Elem)
for (i = 0; i < 6; i++) {
if (Bssid[i] > pAd->CommonCfg.Bssid[i]) {
DBGPRINT(RT_DEBUG_TRACE,
("SYNC - merge to the IBSS with bigger BSSID=%02x:%02x:%02x:%02x:%02x:%02x\n",
Bssid[0], Bssid[1], Bssid[2],
Bssid[3], Bssid[4],
Bssid[5]));
("SYNC - merge to the IBSS "
"with bigger BSSID="
"%pM\n", &Bssid[0]));
AsicDisableSync(pAd);
COPY_MAC_ADDR(pAd->CommonCfg.Bssid,
Bssid);

View File

@ -614,9 +614,7 @@ int rt_ioctl_siwap(struct net_device *dev,
OID_802_11_BSSID,
sizeof(NDIS_802_11_MAC_ADDRESS), (void *) & Bssid);
DBGPRINT(RT_DEBUG_TRACE,
("IOCTL::SIOCSIWAP %02x:%02x:%02x:%02x:%02x:%02x\n", Bssid[0],
Bssid[1], Bssid[2], Bssid[3], Bssid[4], Bssid[5]));
DBGPRINT(RT_DEBUG_TRACE, ("IOCTL::SIOCSIWAP %pM\n", &Bssid[0]));
return 0;
}
@ -1513,11 +1511,8 @@ void getBaInfo(struct rt_rtmp_adapter *pAd, char *pOutBuf)
if (((pEntry->ValidAsCLI || pEntry->ValidAsApCli)
&& (pEntry->Sst == SST_ASSOC))
|| (pEntry->ValidAsWDS) || (pEntry->ValidAsMesh)) {
sprintf(pOutBuf + strlen(pOutBuf),
"\n%02X:%02X:%02X:%02X:%02X:%02X (Aid = %d) (AP) -\n",
pEntry->Addr[0], pEntry->Addr[1],
pEntry->Addr[2], pEntry->Addr[3],
pEntry->Addr[4], pEntry->Addr[5], pEntry->Aid);
sprintf(pOutBuf + strlen(pOutBuf), "\n%pM (Aid = %d) "
"(AP) -\n", &pEntry->Addr[0], pEntry->Aid);
sprintf(pOutBuf, "%s[Recipient]\n", pOutBuf);
for (j = 0; j < NUM_OF_TID; j++) {