mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ieee802154/hal: remove set_hw_addr_filter
This commit is contained in:
parent
44934d300c
commit
6d64b537ef
@ -71,9 +71,12 @@ void _idmanager_addr_override(void)
|
||||
|
||||
/* Set all IEEE addresses */
|
||||
uint16_t panid = OPENWSN_PANID;
|
||||
ieee802154_radio_set_hw_addr_filter(openwsn_radio.dev, &short_addr,
|
||||
&eui64, &panid);
|
||||
|
||||
ieee802154_radio_config_addr_filter(openwsn_radio.dev, IEEE802154_AF_SHORT_ADDR,
|
||||
&short_addr);
|
||||
ieee802154_radio_config_addr_filter(openwsn_radio.dev, IEEE802154_AF_EXT_ADDR,
|
||||
&eui64);
|
||||
ieee802154_radio_config_addr_filter(openwsn_radio.dev, IEEE802154_AF_PANID,
|
||||
&panid);
|
||||
}
|
||||
|
||||
static void _hal_radio_cb(ieee802154_dev_t *dev, ieee802154_trx_ev_t status)
|
||||
|
@ -658,7 +658,6 @@ struct ieee802154_radio_ops {
|
||||
* - @ref config_addr_filter
|
||||
* - @ref set_csma_params
|
||||
* - @ref set_rx_mode
|
||||
* - @ref set_hw_addr_filter
|
||||
* - @ref set_frame_filter_mode
|
||||
* - @ref config_src_addr_match
|
||||
* - @ref set_frame_retrans (if available)
|
||||
@ -791,26 +790,6 @@ struct ieee802154_radio_ops {
|
||||
*/
|
||||
int (*config_phy)(ieee802154_dev_t *dev, const ieee802154_phy_conf_t *conf);
|
||||
|
||||
/**
|
||||
* @brief Set IEEE802.15.4 addresses in hardware address filter
|
||||
*
|
||||
* @pre the device is on
|
||||
*
|
||||
* @param[in] dev IEEE802.15.4 device descriptor
|
||||
* @param[in] short_addr the IEEE802.15.4 short address. If NULL, the short
|
||||
* address is not altered..
|
||||
* @param[in] ext_addr the IEEE802.15.4 extended address (Network Byte Order).
|
||||
* If NULL, the extended address is not altered.
|
||||
* @param[in] pan_id the IEEE802.15.4 PAN ID. If NULL, the PAN ID is not altered.
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return negative errno on error
|
||||
*/
|
||||
int (*set_hw_addr_filter)(ieee802154_dev_t *dev,
|
||||
const network_uint16_t *short_addr,
|
||||
const eui64_t *ext_addr,
|
||||
const uint16_t *pan_id);
|
||||
|
||||
/**
|
||||
* @brief Set number of frame retransmissions
|
||||
*
|
||||
@ -1057,28 +1036,6 @@ static inline int ieee802154_radio_off(ieee802154_dev_t *dev)
|
||||
return dev->driver->off(dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Shortcut to @ref ieee802154_radio_ops::set_hw_addr_filter
|
||||
*
|
||||
* @pre the device is on
|
||||
*
|
||||
* @param[in] dev IEEE802.15.4 device descriptor
|
||||
* @param[in] short_addr the IEEE802.15.4 short address. If NULL, the short
|
||||
* address is not altered..
|
||||
* @param[in] ext_addr the IEEE802.15.4 extended address (Network Byte Order).
|
||||
* If NULL, the extended address is not altered.
|
||||
* @param[in] pan_id the IEEE802.15.4 PAN ID. If NULL, the PAN ID is not altered.
|
||||
*
|
||||
* @return result of @ref ieee802154_radio_ops::set_hw_addr_filter
|
||||
*/
|
||||
static inline int ieee802154_radio_set_hw_addr_filter(ieee802154_dev_t *dev,
|
||||
const network_uint16_t *short_addr,
|
||||
const eui64_t *ext_addr,
|
||||
const uint16_t *pan_id)
|
||||
{
|
||||
return dev->driver->set_hw_addr_filter(dev, short_addr, ext_addr, pan_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Shortcut to @ref ieee802154_radio_ops::config_addr_filter
|
||||
*
|
||||
|
@ -173,8 +173,8 @@ int ieee802154_send(ieee802154_submac_t *submac, const iolist_t *iolist);
|
||||
static inline int ieee802154_set_short_addr(ieee802154_submac_t *submac,
|
||||
const network_uint16_t *short_addr)
|
||||
{
|
||||
int res = ieee802154_radio_set_hw_addr_filter(submac->dev, short_addr, NULL,
|
||||
NULL);
|
||||
|
||||
int res = ieee802154_radio_config_addr_filter(submac->dev, IEEE802154_AF_SHORT_ADDR, short_addr);
|
||||
|
||||
if (res >= 0) {
|
||||
memcpy(&submac->short_addr, short_addr, IEEE802154_SHORT_ADDRESS_LEN);
|
||||
@ -195,8 +195,7 @@ static inline int ieee802154_set_short_addr(ieee802154_submac_t *submac,
|
||||
static inline int ieee802154_set_ext_addr(ieee802154_submac_t *submac,
|
||||
const eui64_t *ext_addr)
|
||||
{
|
||||
int res = ieee802154_radio_set_hw_addr_filter(submac->dev, NULL, ext_addr,
|
||||
NULL);
|
||||
int res = ieee802154_radio_config_addr_filter(submac->dev, IEEE802154_AF_EXT_ADDR, ext_addr);
|
||||
|
||||
if (res >= 0) {
|
||||
memcpy(&submac->ext_addr, ext_addr, IEEE802154_LONG_ADDRESS_LEN);
|
||||
@ -216,8 +215,7 @@ static inline int ieee802154_set_ext_addr(ieee802154_submac_t *submac,
|
||||
static inline int ieee802154_set_panid(ieee802154_submac_t *submac,
|
||||
const uint16_t *panid)
|
||||
{
|
||||
int res = ieee802154_radio_set_hw_addr_filter(submac->dev, NULL, NULL,
|
||||
panid);
|
||||
int res = ieee802154_radio_config_addr_filter(submac->dev, IEEE802154_AF_PANID, panid);
|
||||
|
||||
if (res >= 0) {
|
||||
submac->panid = *panid;
|
||||
|
@ -363,12 +363,10 @@ int ieee802154_submac_init(ieee802154_submac_t *submac, const network_uint16_t *
|
||||
/* If the radio is still not in TRX_OFF state, spin */
|
||||
while (ieee802154_radio_confirm_on(dev) == -EAGAIN) {}
|
||||
|
||||
/* Enable Auto ACK */
|
||||
ieee802154_radio_set_rx_mode(dev, IEEE802154_RX_AACK_ENABLED);
|
||||
|
||||
/* Configure address filter */
|
||||
ieee802154_radio_set_hw_addr_filter(dev, &submac->short_addr,
|
||||
&submac->ext_addr, &submac->panid);
|
||||
ieee802154_radio_config_addr_filter(dev, IEEE802154_AF_SHORT_ADDR, &submac->short_addr);
|
||||
ieee802154_radio_config_addr_filter(dev, IEEE802154_AF_EXT_ADDR, &submac->ext_addr);
|
||||
ieee802154_radio_config_addr_filter(dev, IEEE802154_AF_PANID, &submac->panid);
|
||||
|
||||
/* Configure PHY settings (mode, channel, TX power) */
|
||||
ieee802154_phy_conf_t conf =
|
||||
|
@ -246,7 +246,12 @@ static int _init(void)
|
||||
|
||||
uint16_t panid = CONFIG_IEEE802154_DEFAULT_PANID;
|
||||
/* Set all IEEE addresses */
|
||||
ieee802154_radio_set_hw_addr_filter(ieee802154_hal_test_get_dev(RADIO_DEFAULT_ID), &short_addr, &ext_addr, &panid);
|
||||
ieee802154_radio_config_addr_filter(ieee802154_hal_test_get_dev(RADIO_DEFAULT_ID),
|
||||
IEEE802154_AF_SHORT_ADDR, &short_addr);
|
||||
ieee802154_radio_config_addr_filter(ieee802154_hal_test_get_dev(RADIO_DEFAULT_ID),
|
||||
IEEE802154_AF_EXT_ADDR, &ext_addr);
|
||||
ieee802154_radio_config_addr_filter(ieee802154_hal_test_get_dev(RADIO_DEFAULT_ID),
|
||||
IEEE802154_AF_PANID, &panid);
|
||||
|
||||
/* Set PHY configuration */
|
||||
ieee802154_phy_conf_t conf = {.channel=CONFIG_IEEE802154_DEFAULT_CHANNEL, .page=CONFIG_IEEE802154_DEFAULT_SUBGHZ_PAGE, .pow=CONFIG_IEEE802154_DEFAULT_TXPOWER};
|
||||
|
Loading…
Reference in New Issue
Block a user