diff options
| author | Varka Bhadram <varkabhadram@gmail.com> | 2015-04-30 11:44:52 -0400 |
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2015-04-30 12:48:09 -0400 |
| commit | 42fb23e2f57accbed69804e6d72ea3a88b8a84c4 (patch) | |
| tree | 780189b21be26317592e31ed14c07e19979b2c7f /include/net | |
| parent | c57ddfaea6ec8b1d96f863f7fcfc5554b5dc44c7 (diff) | |
mac802154: add description to mac802154 APIs
This patch adds the proper description to the mac802154 core APIs.
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/mac802154.h | 94 |
1 files changed, 92 insertions, 2 deletions
diff --git a/include/net/mac802154.h b/include/net/mac802154.h index e18e7fd43f47..7df28a4c23f9 100644 --- a/include/net/mac802154.h +++ b/include/net/mac802154.h | |||
| @@ -247,19 +247,109 @@ static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src) | |||
| 247 | __put_unaligned_memmove64(swab64p(le64_src), be64_dst); | 247 | __put_unaligned_memmove64(swab64p(le64_src), be64_dst); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | /* Basic interface to register ieee802154 device */ | 250 | /** |
| 251 | * ieee802154_alloc_hw - Allocate a new hardware device | ||
| 252 | * | ||
| 253 | * This must be called once for each hardware device. The returned pointer | ||
| 254 | * must be used to refer to this device when calling other functions. | ||
| 255 | * mac802154 allocates a private data area for the driver pointed to by | ||
| 256 | * @priv in &struct ieee802154_hw, the size of this area is given as | ||
| 257 | * @priv_data_len. | ||
| 258 | * | ||
| 259 | * @priv_data_len: length of private data | ||
| 260 | * @ops: callbacks for this device | ||
| 261 | * | ||
| 262 | * Return: A pointer to the new hardware device, or %NULL on error. | ||
| 263 | */ | ||
| 251 | struct ieee802154_hw * | 264 | struct ieee802154_hw * |
| 252 | ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops); | 265 | ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops); |
| 266 | |||
| 267 | /** | ||
| 268 | * ieee802154_free_hw - free hardware descriptor | ||
| 269 | * | ||
| 270 | * This function frees everything that was allocated, including the | ||
| 271 | * private data for the driver. You must call ieee802154_unregister_hw() | ||
| 272 | * before calling this function. | ||
| 273 | * | ||
| 274 | * @hw: the hardware to free | ||
| 275 | */ | ||
| 253 | void ieee802154_free_hw(struct ieee802154_hw *hw); | 276 | void ieee802154_free_hw(struct ieee802154_hw *hw); |
| 277 | |||
| 278 | /** | ||
| 279 | * ieee802154_register_hw - Register hardware device | ||
| 280 | * | ||
| 281 | * You must call this function before any other functions in | ||
| 282 | * mac802154. Note that before a hardware can be registered, you | ||
| 283 | * need to fill the contained wpan_phy's information. | ||
| 284 | * | ||
| 285 | * @hw: the device to register as returned by ieee802154_alloc_hw() | ||
| 286 | * | ||
| 287 | * Return: 0 on success. An error code otherwise. | ||
| 288 | */ | ||
| 254 | int ieee802154_register_hw(struct ieee802154_hw *hw); | 289 | int ieee802154_register_hw(struct ieee802154_hw *hw); |
| 290 | |||
| 291 | /** | ||
| 292 | * ieee802154_unregister_hw - Unregister a hardware device | ||
| 293 | * | ||
| 294 | * This function instructs mac802154 to free allocated resources | ||
| 295 | * and unregister netdevices from the networking subsystem. | ||
| 296 | * | ||
| 297 | * @hw: the hardware to unregister | ||
| 298 | */ | ||
| 255 | void ieee802154_unregister_hw(struct ieee802154_hw *hw); | 299 | void ieee802154_unregister_hw(struct ieee802154_hw *hw); |
| 256 | 300 | ||
| 301 | /** | ||
| 302 | * ieee802154_rx - receive frame | ||
| 303 | * | ||
| 304 | * Use this function to hand received frames to mac802154. The receive | ||
| 305 | * buffer in @skb must start with an IEEE 802.15.4 header. In case of a | ||
| 306 | * paged @skb is used, the driver is recommended to put the ieee802154 | ||
| 307 | * header of the frame on the linear part of the @skb to avoid memory | ||
| 308 | * allocation and/or memcpy by the stack. | ||
| 309 | * | ||
| 310 | * This function may not be called in IRQ context. Calls to this function | ||
| 311 | * for a single hardware must be synchronized against each other. | ||
| 312 | * | ||
| 313 | * @hw: the hardware this frame came in on | ||
| 314 | * @skb: the buffer to receive, owned by mac802154 after this call | ||
| 315 | */ | ||
| 257 | void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb); | 316 | void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb); |
| 317 | |||
| 318 | /** | ||
| 319 | * ieee802154_rx_irqsafe - receive frame | ||
| 320 | * | ||
| 321 | * Like ieee802154_rx() but can be called in IRQ context | ||
| 322 | * (internally defers to a tasklet.) | ||
| 323 | * | ||
| 324 | * @hw: the hardware this frame came in on | ||
| 325 | * @skb: the buffer to receive, owned by mac802154 after this call | ||
| 326 | * @lqi: link quality indicator | ||
| 327 | */ | ||
| 258 | void ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb, | 328 | void ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb, |
| 259 | u8 lqi); | 329 | u8 lqi); |
| 260 | 330 | /** | |
| 331 | * ieee802154_wake_queue - wake ieee802154 queue | ||
| 332 | * @hw: pointer as obtained from ieee802154_alloc_hw(). | ||
| 333 | * | ||
| 334 | * Drivers should use this function instead of netif_wake_queue. | ||
| 335 | */ | ||
| 261 | void ieee802154_wake_queue(struct ieee802154_hw *hw); | 336 | void ieee802154_wake_queue(struct ieee802154_hw *hw); |
| 337 | |||
| 338 | /** | ||
| 339 | * ieee802154_stop_queue - stop ieee802154 queue | ||
| 340 | * @hw: pointer as obtained from ieee802154_alloc_hw(). | ||
| 341 | * | ||
| 342 | * Drivers should use this function instead of netif_stop_queue. | ||
| 343 | */ | ||
| 262 | void ieee802154_stop_queue(struct ieee802154_hw *hw); | 344 | void ieee802154_stop_queue(struct ieee802154_hw *hw); |
| 345 | |||
| 346 | /** | ||
| 347 | * ieee802154_xmit_complete - frame transmission complete | ||
| 348 | * | ||
| 349 | * @hw: pointer as obtained from ieee802154_alloc_hw(). | ||
| 350 | * @skb: buffer for transmission | ||
| 351 | * @ifs_handling: indicate interframe space handling | ||
| 352 | */ | ||
| 263 | void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb, | 353 | void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb, |
| 264 | bool ifs_handling); | 354 | bool ifs_handling); |
| 265 | 355 | ||
