static int mac802154_wpan_update_llsec(struct net_device *dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct ieee802154_mlme_ops *ops = ieee802154_mlme_ops(dev);
int rc = 0;
static int
mac802154_wpan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct sockaddr_ieee802154 *sa =
(struct sockaddr_ieee802154 *)&ifr->ifr_addr;
int err = -ENOIOCTLCMD;
int mac802154_set_mac_params(struct net_device *dev,
const struct ieee802154_mac_params *params)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
mutex_lock(&sdata->local->iflist_mtx);
sdata->mac_params = *params;
void mac802154_get_mac_params(struct net_device *dev,
struct ieee802154_mac_params *params)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
mutex_lock(&sdata->local->iflist_mtx);
*params = sdata->mac_params;
static int mac802154_wpan_open(struct net_device *dev)
{
int rc;
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct wpan_phy *phy = sdata->local->phy;
rc = mac802154_slave_open(dev);
unsigned len)
{
struct ieee802154_hdr hdr;
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct ieee802154_mac_cb *cb = mac_cb(skb);
int hlen;
u8 chan, page;
int rc;
- sdata = netdev_priv(dev);
+ sdata = IEEE802154_DEV_TO_SUB_IF(dev);
spin_lock_bh(&sdata->mib_lock);
chan = sdata->chan;
static void mac802154_wpan_free(struct net_device *dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
mac802154_llsec_destroy(&sdata->sec);
dev->netdev_ops = &mac802154_wpan_ops;
dev->ml_priv = &mac802154_mlme_wpan;
- sdata = netdev_priv(dev);
+ sdata = IEEE802154_DEV_TO_SUB_IF(dev);
sdata->type = IEEE802154_DEV_WPAN;
sdata->chan = MAC802154_CHAN_NONE;
static struct ieee802154_local *mac802154_slave_get_priv(struct net_device *dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
static void set_hw_addr_filt(struct net_device *dev, unsigned long changed)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct hw_addr_filt_notify_work *work;
work = kzalloc(sizeof(*work), GFP_ATOMIC);
void mac802154_dev_set_short_addr(struct net_device *dev, __le16 val)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
__le16 mac802154_dev_get_short_addr(const struct net_device *dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
__le16 ret;
BUG_ON(dev->type != ARPHRD_IEEE802154);
void mac802154_dev_set_ieee_addr(struct net_device *dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct ieee802154_local *local = sdata->local;
sdata->extended_addr = ieee802154_devaddr_from_raw(dev->dev_addr);
__le16 mac802154_dev_get_pan_id(const struct net_device *dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
__le16 ret;
BUG_ON(dev->type != ARPHRD_IEEE802154);
void mac802154_dev_set_pan_id(struct net_device *dev, __le16 val)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
u8 mac802154_dev_get_dsn(const struct net_device *dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
{
struct phy_chan_notify_work *nw = container_of(work,
struct phy_chan_notify_work, work);
- struct ieee802154_local *local = mac802154_slave_get_priv(nw->dev);
- struct ieee802154_sub_if_data *sdata = netdev_priv(nw->dev);
+ struct net_device *dev = nw->dev;
+ struct ieee802154_local *local = mac802154_slave_get_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
mutex_lock(&sdata->local->phy->pib_lock);
void mac802154_dev_set_page_channel(struct net_device *dev, u8 page, u8 chan)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct phy_chan_notify_work *work;
BUG_ON(dev->type != ARPHRD_IEEE802154);
int mac802154_get_params(struct net_device *dev,
struct ieee802154_llsec_params *params)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
const struct ieee802154_llsec_params *params,
int changed)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
const struct ieee802154_llsec_key_id *id,
const struct ieee802154_llsec_key *key)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
int mac802154_del_key(struct net_device *dev,
const struct ieee802154_llsec_key_id *id)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
int mac802154_add_dev(struct net_device *dev,
const struct ieee802154_llsec_device *llsec_dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
int mac802154_del_dev(struct net_device *dev, __le64 dev_addr)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
__le64 device_addr,
const struct ieee802154_llsec_device_key *key)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
__le64 device_addr,
const struct ieee802154_llsec_device_key *key)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
int mac802154_add_seclevel(struct net_device *dev,
const struct ieee802154_llsec_seclevel *sl)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
int mac802154_del_seclevel(struct net_device *dev,
const struct ieee802154_llsec_seclevel *sl)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
void mac802154_lock_table(struct net_device *dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
void mac802154_get_table(struct net_device *dev,
struct ieee802154_llsec_table **t)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
void mac802154_unlock_table(struct net_device *dev)
{
- struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
+ struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);