static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
{
- char eabuf[ETHER_ADDR_STR_LEN];
-
struct bcmstrbuf b;
struct bcmstrbuf *strbuf = &b;
dhdp->up, dhdp->txoff, dhdp->busstate);
bcm_bprintf(strbuf, "pub.hdrlen %d pub.maxctl %d pub.rxsz %d\n",
dhdp->hdrlen, dhdp->maxctl, dhdp->rxsz);
- bcm_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %s\n",
- dhdp->iswl, dhdp->drv_version, bcm_ether_ntoa(&dhdp->mac,
- eabuf));
+ bcm_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %pM\n",
+ dhdp->iswl, dhdp->drv_version, &dhdp->mac);
bcm_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", dhdp->bcmerror,
dhdp->tickcnt);
auth_type = ntoh32(event->auth_type);
datalen = ntoh32(event->datalen);
/* debug dump of event messages */
- sprintf(eabuf, "%02x:%02x:%02x:%02x:%02x:%02x",
- (unsigned char) event->addr.octet[0] & 0xff,
- (unsigned char) event->addr.octet[1] & 0xff,
- (unsigned char) event->addr.octet[2] & 0xff,
- (unsigned char) event->addr.octet[3] & 0xff,
- (unsigned char) event->addr.octet[4] & 0xff,
- (unsigned char) event->addr.octet[5] & 0xff);
+ sprintf(eabuf, "%pM", event->addr.octet);
event_name = "UNKNOWN";
for (i = 0; i < ARRAY_SIZE(event_names); i++) {
wl_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
s32 err)
{
- s8 eabuf[ETHER_ADDR_STR_LEN];
int i, j;
- memset(eabuf, 0, ETHER_ADDR_STR_LEN);
-
WL_DBG(("No of elements %d\n", pmk_list->pmkids.npmkid));
for (i = 0; i < pmk_list->pmkids.npmkid; i++) {
- WL_DBG(("PMKID[%d]: %s =\n", i,
- bcm_ether_ntoa(&pmk_list->pmkids.pmkid[i].BSSID,
- eabuf)));
+ WL_DBG(("PMKID[%d]: %pM =\n", i,
+ &pmk_list->pmkids.pmkid[i].BSSID));
for (j = 0; j < WPA2_PMKID_LEN; j++) {
WL_DBG(("%02x\n", pmk_list->pmkids.pmkid[i].PMKID[j]));
}
struct cfg80211_pmksa *pmksa)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
- s8 eabuf[ETHER_ADDR_STR_LEN];
s32 err = 0;
int i;
CHECK_SYS_UP();
- memset(eabuf, 0, ETHER_ADDR_STR_LEN);
for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++)
if (!memcmp(pmksa->bssid, &wl->pmk_list->pmkids.pmkid[i].BSSID,
ETHER_ADDR_LEN))
} else {
err = -EINVAL;
}
- WL_DBG(("set_pmksa,IW_PMKSA_ADD - PMKID: %s =\n",
- bcm_ether_ntoa(&wl->pmk_list->pmkids.
- pmkid[wl->pmk_list->pmkids.npmkid].BSSID,
- eabuf)));
+ WL_DBG(("set_pmksa,IW_PMKSA_ADD - PMKID: %pM =\n",
+ &wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].BSSID));
for (i = 0; i < WPA2_PMKID_LEN; i++) {
WL_DBG(("%02x\n",
wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].
struct cfg80211_pmksa *pmksa)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
- s8 eabuf[ETHER_ADDR_STR_LEN];
struct _pmkid_list pmkid;
s32 err = 0;
int i;
CHECK_SYS_UP();
- memset(eabuf, 0, ETHER_ADDR_STR_LEN);
memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETHER_ADDR_LEN);
memcpy(&pmkid.pmkid[0].PMKID, pmksa->pmkid, WPA2_PMKID_LEN);
- WL_DBG(("del_pmksa,IW_PMKSA_REMOVE - PMKID: %s =\n",
- bcm_ether_ntoa(&pmkid.pmkid[0].BSSID, eabuf)));
+ WL_DBG(("del_pmksa,IW_PMKSA_REMOVE - PMKID: %pM =\n",
+ &pmkid.pmkid[0].BSSID));
for (i = 0; i < WPA2_PMKID_LEN; i++) {
WL_DBG(("%02x\n", pmkid.pmkid[0].PMKID[i]));
}
if (unlikely(err))
goto update_bss_info_out;
} else {
- WL_DBG(("Found the AP in the list - "
- "BSSID %02x:%02x:%02x:%02x:%02x:%02x\n",
- bss->bssid[0], bss->bssid[1], bss->bssid[2],
- bss->bssid[3], bss->bssid[4], bss->bssid[5]));
+ WL_DBG(("Found the AP in the list - BSSID %pM\n", bss->bssid));
cfg80211_put_bss(bss);
}
}
if (g_ssid.SSID_len) {
- WL_TRACE(("%s: join SSID=%s BSSID=" MACSTR " ch=%d\n",
- __func__, g_ssid.SSID,
- MAC2STR((u8 *) awrq->sa_data),
+ WL_TRACE(("%s: join SSID=%s BSSID=%pM ch=%d\n",
+ __func__, g_ssid.SSID, awrq->sa_data,
g_wl_iw_params.target_channel));
}
struct iw_pmksa *iwpmksa;
uint i;
int ret = 0;
- char eabuf[ETHER_ADDR_STR_LEN];
WL_WSEC(("%s: SIOCSIWPMKSA\n", dev->name));
CHECK_EXTRA_FOR_NULL(extra);
iwpmksa = (struct iw_pmksa *)extra;
- bzero((char *)eabuf, ETHER_ADDR_STR_LEN);
if (iwpmksa->cmd == IW_PMKSA_FLUSH) {
WL_WSEC(("wl_iw_set_pmksa - IW_PMKSA_FLUSH\n"));
bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID,
WPA2_PMKID_LEN);
- WL_WSEC(("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: %s = ",
- bcm_ether_ntoa(&pmkidptr->pmkid[0].BSSID, eabuf)));
+ WL_WSEC(("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: "
+ "%pM = ", &pmkidptr->pmkid[0].BSSID));
for (j = 0; j < WPA2_PMKID_LEN; j++)
WL_WSEC(("%02x ", pmkidptr->pmkid[0].PMKID[j]));
WL_WSEC(("\n"));
uint j;
uint k;
k = pmkid_list.pmkids.npmkid;
- WL_WSEC(("wl_iw_set_pmksa,IW_PMKSA_ADD - PMKID: %s = ",
- bcm_ether_ntoa(&pmkid_list.pmkids.pmkid[k].
- BSSID, eabuf)));
+ WL_WSEC(("wl_iw_set_pmksa,IW_PMKSA_ADD - PMKID: %pM = ",
+ &pmkid_list.pmkids.pmkid[k].BSSID));
for (j = 0; j < WPA2_PMKID_LEN; j++)
WL_WSEC(("%02x ",
pmkid_list.pmkids.pmkid[k].PMKID[j]));
pmkid_list.pmkids.npmkid));
for (i = 0; i < pmkid_list.pmkids.npmkid; i++) {
uint j;
- WL_WSEC(("PMKID[%d]: %s = ", i,
- bcm_ether_ntoa(&pmkid_list.pmkids.pmkid[i].BSSID,
- eabuf)));
+ WL_WSEC(("PMKID[%d]: %pM = ", i,
+ &pmkid_list.pmkids.pmkid[i].BSSID));
for (j = 0; j < WPA2_PMKID_LEN; j++)
WL_WSEC(("%02x ", pmkid_list.pmkids.pmkid[i].PMKID[j]));
WL_WSEC(("\n"));
#define PNOENABLE_SET_CMD "PNOFORCE"
#define PNODEBUG_SET_CMD "PNODEBUG"
-#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
-#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
-
typedef struct wl_iw_extra_params {
int target_channel;
} wl_iw_extra_params_t;
#define PKTPRIO_DSCP 0x800 /* DSCP prio found */
/* ethernet address */
- extern char *bcm_ether_ntoa(const struct ether_addr *ea, char *buf);
extern int bcm_ether_atoe(char *p, struct ether_addr *ea);
/* ip address */
/* Check that bcm_tlv_t fits into the given buflen */
#define bcm_valid_tlv(elt, buflen) ((buflen) >= 2 && (int)(buflen) >= (int)(2 + (elt)->len))
-/* buffer length for ethernet address from bcm_ether_ntoa() */
#define ETHER_ADDR_STR_LEN 18 /* 18-bytes of Ethernet address buffer length */
/* crypto utility function */
/* Beacon interval changed */
}
if (changed & BSS_CHANGED_BSSID) {
- /* char eabuf[ETHER_ADDR_STR_LEN]; */
- WL_NONE(("new BSSID:\taid %d bss:%s\n",
- info->aid,
- bcm_ether_ntoa((struct ether_addr *)info->bssid,
- eabuf)));
+ WL_NONE(("new BSSID:\taid %d bss:%pM\n", info->aid,
+ info->bssid));
/* BSSID changed, for whatever reason (IBSS and managed mode) */
/* FIXME: need to store bssid in bsscfg */
wlc_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET,
u16 fc;
uint len;
bool is_amsdu;
-#ifdef BCMDBG
- char eabuf[ETHER_ADDR_STR_LEN];
-#endif
WL_TRACE(("wl%d: wlc_recv\n", wlc->pub->unit));
/* CTS and ACK CTL frames are w/o a2 */
if (FC_TYPE(fc) == FC_TYPE_DATA || FC_TYPE(fc) == FC_TYPE_MNG) {
if ((ETHER_ISNULLADDR(&h->a2) || ETHER_ISMULTI(&h->a2))) {
- WL_ERROR(("wl%d: %s: dropping a frame with invalid" " src mac address, a2: %s\n", wlc->pub->unit, __func__, bcm_ether_ntoa(&h->a2, eabuf)));
+ WL_ERROR(("wl%d: %s: dropping a frame with "
+ "invalid src mac address, a2: %pM\n",
+ wlc->pub->unit, __func__, &h->a2));
WLCNTINCR(wlc->pub->_cnt->rxbadsrcmac);
goto toss;
}
&& !(ETHER_ISMULTI(&cis[i + 2]))) {
ASSERT(cis[i + 1] ==
ETHER_ADDR_LEN);
- bcm_ether_ntoa(
- (struct ether_addr *)
- &cis[i + 2],
- eabuf);
+ snprintf(eabuf, sizeof(eabuf),
+ "%pM", &cis[i + 2]);
/* set boardnum if HNBU_BOARDNUM not seen yet */
if (boardnum == -1)
case HNBU_MACADDR:
if (!(ETHER_ISNULLADDR(&cis[i + 1])) &&
!(ETHER_ISMULTI(&cis[i + 1]))) {
- bcm_ether_ntoa(
- (struct ether_addr *)
- &cis[i + 1],
- eabuf);
+ snprintf(eabuf, sizeof(eabuf),
+ "%pM", &cis[i + 1]);
/* set boardnum if HNBU_BOARDNUM not seen yet */
if (boardnum == -1)
continue;
if (flags & SRFL_ETHADDR) {
- char eabuf[ETHER_ADDR_STR_LEN];
struct ether_addr ea;
ea.octet[0] = (srom[srv->off - off] >> 8) & 0xff;
ea.octet[3] = srom[srv->off + 1 - off] & 0xff;
ea.octet[4] = (srom[srv->off + 2 - off] >> 8) & 0xff;
ea.octet[5] = srom[srv->off + 2 - off] & 0xff;
- bcm_ether_ntoa(&ea, eabuf);
- varbuf_append(b, "%s=%s", name, eabuf);
+ varbuf_append(b, "%s=%pM", name, ea.octet);
} else {
ASSERT(mask_valid(srv->mask));
ASSERT(mask_width(srv->mask));
return i == 6;
}
-char *bcm_ether_ntoa(const struct ether_addr *ea, char *buf)
-{
- snprintf(buf, 18, "%pM", ea->octet);
- return buf;
-}
-
/*
* Search the name=value vars for a specific one and return its value.
* Returns NULL if not found.