mac802154: tx: add support for xmit_async callback
[deliverable/linux.git] / include / net / mac802154.h
index 2e67cdd19cdc6d34c322056c52dc72fedf2c416b..57b120281afc13062fdadaf11c4ca9c775c92ab1 100644 (file)
@@ -12,9 +12,6 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 #ifndef NET_MAC802154_H
 #define NET_MAC802154_H
  */
 
 /* indicates that the Short Address changed */
-#define IEEE802515_AFILT_SADDR_CHANGED         0x00000001
+#define IEEE802154_AFILT_SADDR_CHANGED         0x00000001
 /* indicates that the IEEE Address changed */
-#define IEEE802515_AFILT_IEEEADDR_CHANGED      0x00000002
+#define IEEE802154_AFILT_IEEEADDR_CHANGED      0x00000002
 /* indicates that the PAN ID changed */
-#define IEEE802515_AFILT_PANID_CHANGED         0x00000004
+#define IEEE802154_AFILT_PANID_CHANGED         0x00000004
 /* indicates that PAN Coordinator status changed */
-#define        IEEE802515_AFILT_PANC_CHANGED           0x00000008
+#define IEEE802154_AFILT_PANC_CHANGED          0x00000008
 
 struct ieee802154_hw_addr_filt {
        __le16  pan_id;         /* Each independent PAN selects a unique
@@ -55,7 +52,7 @@ struct ieee802154_hw_addr_filt {
        u8      pan_coord;
 };
 
-struct ieee802154_dev {
+struct ieee802154_hw {
        /* filled by the driver */
        int     extra_tx_headroom;
        u32     flags;
@@ -112,12 +109,20 @@ struct ieee802154_dev {
  * stop:  Handler that 802.15.4 module calls for device cleanup.
  *       This function is called after the last interface is removed.
  *
- * xmit:  Handler that 802.15.4 module calls for each transmitted frame.
+ * xmit_sync:
+ *       Handler that 802.15.4 module calls for each transmitted frame.
+ *       skb cntains the buffer starting from the IEEE 802.15.4 header.
+ *       The low-level driver should send the frame based on available
+ *       configuration. This is called by a workqueue and useful for
+ *       synchronous 802.15.4 drivers.
+ *       This function should return zero or negative errno.
+ *
+ * xmit_async:
+ *       Handler that 802.15.4 module calls for each transmitted frame.
  *       skb cntains the buffer starting from the IEEE 802.15.4 header.
  *       The low-level driver should send the frame based on available
  *       configuration.
- *       This function should return zero or negative errno. Called with
- *       pib_lock held.
+ *       This function should return zero or negative errno.
  *
  * ed:    Handler that 802.15.4 module calls for Energy Detection.
  *       This function should place the value for detected energy
@@ -162,37 +167,42 @@ struct ieee802154_dev {
  */
 struct ieee802154_ops {
        struct module   *owner;
-       int             (*start)(struct ieee802154_dev *dev);
-       void            (*stop)(struct ieee802154_dev *dev);
-       int             (*xmit)(struct ieee802154_dev *dev,
-                               struct sk_buff *skb);
-       int             (*ed)(struct ieee802154_dev *dev, u8 *level);
-       int             (*set_channel)(struct ieee802154_dev *dev,
+       int             (*start)(struct ieee802154_hw *hw);
+       void            (*stop)(struct ieee802154_hw *hw);
+       int             (*xmit_sync)(struct ieee802154_hw *hw,
+                                    struct sk_buff *skb);
+       int             (*xmit_async)(struct ieee802154_hw *hw,
+                                     struct sk_buff *skb);
+       int             (*ed)(struct ieee802154_hw *hw, u8 *level);
+       int             (*set_channel)(struct ieee802154_hw *hw,
                                       int page,
                                       int channel);
-       int             (*set_hw_addr_filt)(struct ieee802154_dev *dev,
-                                         struct ieee802154_hw_addr_filt *filt,
+       int             (*set_hw_addr_filt)(struct ieee802154_hw *hw,
+                                           struct ieee802154_hw_addr_filt *filt,
                                            unsigned long changed);
-       int             (*ieee_addr)(struct ieee802154_dev *dev, __le64 addr);
-       int             (*set_txpower)(struct ieee802154_dev *dev, int db);
-       int             (*set_lbt)(struct ieee802154_dev *dev, bool on);
-       int             (*set_cca_mode)(struct ieee802154_dev *dev, u8 mode);
-       int             (*set_cca_ed_level)(struct ieee802154_dev *dev,
+       int             (*set_txpower)(struct ieee802154_hw *hw, int db);
+       int             (*set_lbt)(struct ieee802154_hw *hw, bool on);
+       int             (*set_cca_mode)(struct ieee802154_hw *hw, u8 mode);
+       int             (*set_cca_ed_level)(struct ieee802154_hw *hw,
                                            s32 level);
-       int             (*set_csma_params)(struct ieee802154_dev *dev,
+       int             (*set_csma_params)(struct ieee802154_hw *hw,
                                           u8 min_be, u8 max_be, u8 retries);
-       int             (*set_frame_retries)(struct ieee802154_dev *dev,
+       int             (*set_frame_retries)(struct ieee802154_hw *hw,
                                             s8 retries);
 };
 
-/* Basic interface to register ieee802154 device */
-struct ieee802154_dev *
-ieee802154_alloc_device(size_t priv_data_len, struct ieee802154_ops *ops);
-void ieee802154_free_device(struct ieee802154_dev *dev);
-int ieee802154_register_device(struct ieee802154_dev *dev);
-void ieee802154_unregister_device(struct ieee802154_dev *dev);
+/* Basic interface to register ieee802154 hwice */
+struct ieee802154_hw *
+ieee802154_alloc_hw(size_t priv_data_len, struct ieee802154_ops *ops);
+void ieee802154_free_hw(struct ieee802154_hw *hw);
+int ieee802154_register_hw(struct ieee802154_hw *hw);
+void ieee802154_unregister_hw(struct ieee802154_hw *hw);
 
-void ieee802154_rx_irqsafe(struct ieee802154_dev *dev, struct sk_buff *skb,
+void ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb,
                           u8 lqi);
 
+void ieee802154_wake_queue(struct ieee802154_hw *hw);
+void ieee802154_stop_queue(struct ieee802154_hw *hw);
+void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb);
+
 #endif /* NET_MAC802154_H */
This page took 0.025952 seconds and 5 git commands to generate.