mac802154: Handle associating
[linux-2.6-block.git] / net / mac802154 / ieee802154_i.h
index c347ec9ff8c942cd38e7d75c83b79bcc832dccd9..fff67676b400dcebca85fbd9387a5ea2e7f73bc7 100644 (file)
@@ -24,6 +24,7 @@
 enum ieee802154_ongoing {
        IEEE802154_IS_SCANNING = BIT(0),
        IEEE802154_IS_BEACONING = BIT(1),
+       IEEE802154_IS_ASSOCIATING = BIT(2),
 };
 
 /* mac802154 device private data */
@@ -74,6 +75,13 @@ struct ieee802154_local {
        struct list_head rx_mac_cmd_list;
        struct work_struct rx_mac_cmd_work;
 
+       /* Association */
+       struct ieee802154_pan_device *assoc_dev;
+       struct completion assoc_done;
+       __le16 assoc_addr;
+       u8 assoc_status;
+       struct work_struct assoc_work;
+
        bool started;
        bool suspended;
        unsigned long ongoing;
@@ -296,6 +304,17 @@ static inline bool mac802154_is_beaconing(struct ieee802154_local *local)
 
 void mac802154_rx_mac_cmd_worker(struct work_struct *work);
 
+int mac802154_perform_association(struct ieee802154_sub_if_data *sdata,
+                                 struct ieee802154_pan_device *coord,
+                                 __le16 *short_addr);
+int mac802154_process_association_resp(struct ieee802154_sub_if_data *sdata,
+                                      struct sk_buff *skb);
+
+static inline bool mac802154_is_associating(struct ieee802154_local *local)
+{
+       return test_bit(IEEE802154_IS_ASSOCIATING, &local->ongoing);
+}
+
 /* interface handling */
 int ieee802154_iface_init(void);
 void ieee802154_iface_exit(void);