mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
ieee802154: Minor changes to align closer with coding standard
This commit is contained in:
@@ -1726,7 +1726,7 @@ static uint32_t mac802154_symtoticks(FAR struct ieee802154_privmac_s *priv,
|
||||
* get overall times.
|
||||
*/
|
||||
|
||||
priv->radio->get_attr(priv->radio, IEEE802154_ATTR_PHY_SYMBOL_DURATION,
|
||||
priv->radio->getattr(priv->radio, IEEE802154_ATTR_PHY_SYMBOL_DURATION,
|
||||
&attrval);
|
||||
|
||||
/* After this step, ret represents microseconds */
|
||||
@@ -1912,7 +1912,7 @@ MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev)
|
||||
}
|
||||
|
||||
IEEE802154_EADDRCOPY(mac->addr.eaddr, eaddr);
|
||||
mac->radio->set_attr(mac->radio, IEEE802154_ATTR_MAC_EADDR,
|
||||
mac->radio->setattr(mac->radio, IEEE802154_ATTR_MAC_EADDR,
|
||||
(union ieee802154_attr_u *)&eaddr[0]);
|
||||
|
||||
return (MACHANDLE)mac;
|
||||
|
||||
@@ -127,8 +127,6 @@ int mac802154_req_associate(MACHANDLE mac,
|
||||
|
||||
mac802154_setcoordaddr(priv, &req->coordaddr);
|
||||
|
||||
/* TODO: Need to send coordinator address to radio layer */
|
||||
|
||||
/* Copy the coordinator PAN ID to our PAN ID */
|
||||
|
||||
mac802154_setpanid(priv, req->coordaddr.panid);
|
||||
@@ -146,7 +144,7 @@ int mac802154_req_associate(MACHANDLE mac,
|
||||
*/
|
||||
|
||||
rxonidle = req->capabilities.rxonidle;
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_RX_ON_WHEN_IDLE,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_RX_ON_WHEN_IDLE,
|
||||
(FAR const union ieee802154_attr_u *)&rxonidle);
|
||||
|
||||
/* Allocate an IOB to put the frame in */
|
||||
@@ -709,7 +707,7 @@ void mac802154_rx_assocresp(FAR struct ieee802154_privmac_s *priv,
|
||||
|
||||
/* Inform the radio of the address change */
|
||||
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_SADDR,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_SADDR,
|
||||
(FAR union ieee802154_attr_u *)priv->addr.saddr);
|
||||
|
||||
/* A Short Address field value equal to 0xfffe shall indicate that the device
|
||||
|
||||
@@ -106,7 +106,7 @@ int mac802154_req_get(MACHANDLE mac, enum ieee802154_attr_e attr,
|
||||
* it along.
|
||||
*/
|
||||
|
||||
ret = priv->radio->get_attr(priv->radio, attr, attrval);
|
||||
ret = priv->radio->getattr(priv->radio, attr, attrval);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ int mac802154_req_set(MACHANDLE mac, enum ieee802154_attr_e attr,
|
||||
* it along.
|
||||
*/
|
||||
|
||||
ret = priv->radio->set_attr(priv->radio, attr, attrval);
|
||||
ret = priv->radio->setattr(priv->radio, attr, attrval);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,6 @@ struct ieee802154_privmac_s
|
||||
|
||||
sem_t exclsem; /* Support exclusive access */
|
||||
uint8_t nclients; /* Number of notification clients */
|
||||
uint8_t nnotif; /* Number of remaining notifications */
|
||||
|
||||
/* Only support a single command at any given time. As of now I see no
|
||||
* condition where you need to have more than one command frame simultaneously
|
||||
@@ -642,14 +641,14 @@ static inline void mac802154_rxdisable(FAR struct ieee802154_privmac_s *priv)
|
||||
static inline void mac802154_setchannel(FAR struct ieee802154_privmac_s *priv,
|
||||
uint8_t channel)
|
||||
{
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_PHY_CHAN,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_PHY_CHAN,
|
||||
(FAR const union ieee802154_attr_u *)&channel);
|
||||
}
|
||||
|
||||
static inline void mac802154_setchpage(FAR struct ieee802154_privmac_s *priv,
|
||||
uint8_t chpage)
|
||||
{
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_PHY_CURRENT_PAGE,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_PHY_CURRENT_PAGE,
|
||||
(FAR const union ieee802154_attr_u *)&chpage);
|
||||
}
|
||||
|
||||
@@ -657,7 +656,7 @@ static inline void mac802154_setpanid(FAR struct ieee802154_privmac_s *priv,
|
||||
const uint8_t *panid)
|
||||
{
|
||||
IEEE802154_PANIDCOPY(priv->addr.panid, panid);
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_PANID,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_PANID,
|
||||
(FAR const union ieee802154_attr_u *)panid);
|
||||
}
|
||||
|
||||
@@ -665,7 +664,7 @@ static inline void mac802154_setsaddr(FAR struct ieee802154_privmac_s *priv,
|
||||
const uint8_t *saddr)
|
||||
{
|
||||
IEEE802154_SADDRCOPY(priv->addr.saddr, saddr);
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_SADDR,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_SADDR,
|
||||
(FAR const union ieee802154_attr_u *)saddr);
|
||||
}
|
||||
|
||||
@@ -673,7 +672,7 @@ static inline void mac802154_seteaddr(FAR struct ieee802154_privmac_s *priv,
|
||||
const uint8_t *eaddr)
|
||||
{
|
||||
IEEE802154_EADDRCOPY(priv->addr.eaddr, eaddr);
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_EADDR,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_EADDR,
|
||||
(FAR const union ieee802154_attr_u *)eaddr);
|
||||
}
|
||||
|
||||
@@ -681,7 +680,7 @@ static inline void mac802154_setcoordsaddr(FAR struct ieee802154_privmac_s *priv
|
||||
const uint8_t *saddr)
|
||||
{
|
||||
IEEE802154_SADDRCOPY(priv->pandesc.coordaddr.saddr, saddr);
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_COORD_SADDR,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_COORD_SADDR,
|
||||
(FAR const union ieee802154_attr_u *)saddr);
|
||||
}
|
||||
|
||||
@@ -689,7 +688,7 @@ static inline void mac802154_setcoordeaddr(FAR struct ieee802154_privmac_s *priv
|
||||
const uint8_t *eaddr)
|
||||
{
|
||||
IEEE802154_EADDRCOPY(priv->pandesc.coordaddr.eaddr, eaddr);
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_COORD_EADDR,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_COORD_EADDR,
|
||||
(FAR const union ieee802154_attr_u *)eaddr);
|
||||
}
|
||||
|
||||
@@ -697,9 +696,9 @@ static inline void mac802154_setcoordaddr(FAR struct ieee802154_privmac_s *priv,
|
||||
FAR const struct ieee802154_addr_s *addr)
|
||||
{
|
||||
memcpy(&priv->pandesc.coordaddr, addr, sizeof(struct ieee802154_addr_s));
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_COORD_EADDR,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_COORD_EADDR,
|
||||
(FAR const union ieee802154_attr_u *)addr->eaddr);
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_MAC_COORD_SADDR,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_MAC_COORD_SADDR,
|
||||
(FAR const union ieee802154_attr_u *)addr->saddr);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,14 +125,14 @@ int mac802154_req_reset(MACHANDLE mac, bool rst_pibattr)
|
||||
IEEE802154_SADDRCOPY(priv->addr.saddr, &IEEE802154_SADDR_UNSPEC);
|
||||
IEEE802154_EADDRCOPY(priv->addr.eaddr, &IEEE802154_EADDR_UNSPEC);
|
||||
|
||||
priv->radio->reset_attrs(priv->radio);
|
||||
priv->radio->reset(priv->radio);
|
||||
|
||||
/* The radio is in control of certain attributes, but we keep a mirror
|
||||
* for easy access. Copy in the radio's values now that they've been
|
||||
* reset.
|
||||
*/
|
||||
|
||||
priv->radio->get_attr(priv->radio, IEEE802154_ATTR_MAC_MAX_FRAME_WAITTIME,
|
||||
priv->radio->getattr(priv->radio, IEEE802154_ATTR_MAC_MAX_FRAME_WAITTIME,
|
||||
&attr);
|
||||
priv->max_frame_waittime = attr.mac.max_frame_waittime;
|
||||
|
||||
|
||||
@@ -93,6 +93,8 @@ int mac802154_req_scan(MACHANDLE mac, FAR struct ieee802154_scan_req_s *req)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
wlinfo("MLME: SCAN.request received\n");
|
||||
|
||||
/* Need to get access to the ops semaphore since operations are serial. This
|
||||
* must be done before locking the MAC so that we don't hold the MAC
|
||||
*/
|
||||
@@ -126,6 +128,8 @@ int mac802154_req_scan(MACHANDLE mac, FAR struct ieee802154_scan_req_s *req)
|
||||
{
|
||||
case IEEE802154_SCANTYPE_PASSIVE:
|
||||
{
|
||||
wlinfo("MLME: Starting Passive scan\n");
|
||||
|
||||
/* Set the channel to the first channel in the list */
|
||||
|
||||
mac802154_setchannel(priv, req->channels[priv->scanindex]);
|
||||
|
||||
@@ -101,9 +101,9 @@ int mac802154_req_start(MACHANDLE mac, FAR struct ieee802154_start_req_s *req)
|
||||
|
||||
/* Tell the radio layer to set the channel number and channel page */
|
||||
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_PHY_CHAN,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_PHY_CHAN,
|
||||
(FAR const union ieee802154_attr_u *)&req->chan);
|
||||
priv->radio->set_attr(priv->radio, IEEE802154_ATTR_PHY_CURRENT_PAGE,
|
||||
priv->radio->setattr(priv->radio, IEEE802154_ATTR_PHY_CURRENT_PAGE,
|
||||
(FAR const union ieee802154_attr_u *)&req->chpage);
|
||||
|
||||
/* The address used in the Source Address field of the beacon frame shall
|
||||
|
||||
Reference in New Issue
Block a user