/** * fake_assoc_req - Make an association request to the HW. * @dev: The network device which we are associating to a network. * @addr: The coordinator with which we wish to associate. * @channel: The channel on which to associate. * @cap: The capability information field to use in the association. * * Start an association with a coordinator. The coordinator's address * and PAN ID can be found in @addr. * * Note: This is in section 7.3.1 and 7.5.3.1 of the IEEE * 802.15.4-2006 document. */ static int fake_assoc_req(struct net_device *dev, struct ieee802154_addr *addr, u8 channel, u8 page, u8 cap) { struct wpan_phy *phy = fake_to_phy(dev); mutex_lock(&phy->pib_lock); phy->current_channel = channel; phy->current_page = page; mutex_unlock(&phy->pib_lock); /* We simply emulate it here */ return ieee802154_nl_assoc_confirm(dev, fake_get_short_addr(dev), IEEE802154_SUCCESS); }
/** * xbee_assoc_req - Make an association request to the HW. * @dev: The network device which we are associating to a network. * @addr: The coordinator with which we wish to associate. * @channel: The channel on which to associate. * @cap: The capability information field to use in the association. * * Start an association with a coordinator. The coordinator's address * and PAN ID can be found in @addr. * * Note: This is in section 7.3.1 and 7.5.3.1 of the IEEE * 802.15.4-2006 document. */ static int xbee_assoc_req(struct net_device *dev, struct ieee802154_addr *addr, u8 channel, u8 page, u8 cap) { struct wpan_phy *phy = xbee_to_phy(dev); mutex_lock(&phy->pib_lock); phy->current_channel = channel; phy->current_page = page; mutex_unlock(&phy->pib_lock); printk(KERN_ALERT "Association request confirmed!\n"); /* We simply emulate it here */ return ieee802154_nl_assoc_confirm(dev, xbee_get_short_addr(dev), IEEE802154_SUCCESS); }