Commit 52a8d963 authored by Inaky Perez-Gonzalez's avatar Inaky Perez-Gonzalez

wimax: document why wimax_msg_*() operations can be used in any state

Funcion documentation for wimax_msg_alloc() and wimax_msg_send() needs
to clarify that they can be used in the very early stages of a
wimax_dev lifecycle.
Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
parent 052991d7
...@@ -108,6 +108,12 @@ ...@@ -108,6 +108,12 @@
* Don't use skb_push()/skb_pull()/skb_reserve() on the skb, as * Don't use skb_push()/skb_pull()/skb_reserve() on the skb, as
* wimax_msg_send() depends on skb->data being placed at the * wimax_msg_send() depends on skb->data being placed at the
* beginning of the user message. * beginning of the user message.
*
* Unlike other WiMAX stack calls, this call can be used way early,
* even before wimax_dev_add() is called, as long as the
* wimax_dev->net_dev pointer is set to point to a proper
* net_dev. This is so that drivers can use it early in case they need
* to send stuff around or communicate with user space.
*/ */
struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev, struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev,
const char *pipe_name, const char *pipe_name,
...@@ -115,7 +121,7 @@ struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev, ...@@ -115,7 +121,7 @@ struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev,
gfp_t gfp_flags) gfp_t gfp_flags)
{ {
int result; int result;
struct device *dev = wimax_dev->net_dev->dev.parent; struct device *dev = wimax_dev_to_dev(wimax_dev);
size_t msg_size; size_t msg_size;
void *genl_msg; void *genl_msg;
struct sk_buff *skb; struct sk_buff *skb;
...@@ -161,7 +167,6 @@ error_genlmsg_put: ...@@ -161,7 +167,6 @@ error_genlmsg_put:
error_new: error_new:
nlmsg_free(skb); nlmsg_free(skb);
return ERR_PTR(result); return ERR_PTR(result);
} }
EXPORT_SYMBOL_GPL(wimax_msg_alloc); EXPORT_SYMBOL_GPL(wimax_msg_alloc);
...@@ -256,10 +261,16 @@ EXPORT_SYMBOL_GPL(wimax_msg_len); ...@@ -256,10 +261,16 @@ EXPORT_SYMBOL_GPL(wimax_msg_len);
* Don't use skb_push()/skb_pull()/skb_reserve() on the skb, as * Don't use skb_push()/skb_pull()/skb_reserve() on the skb, as
* wimax_msg_send() depends on skb->data being placed at the * wimax_msg_send() depends on skb->data being placed at the
* beginning of the user message. * beginning of the user message.
*
* Unlike other WiMAX stack calls, this call can be used way early,
* even before wimax_dev_add() is called, as long as the
* wimax_dev->net_dev pointer is set to point to a proper
* net_dev. This is so that drivers can use it early in case they need
* to send stuff around or communicate with user space.
*/ */
int wimax_msg_send(struct wimax_dev *wimax_dev, struct sk_buff *skb) int wimax_msg_send(struct wimax_dev *wimax_dev, struct sk_buff *skb)
{ {
struct device *dev = wimax_dev->net_dev->dev.parent; struct device *dev = wimax_dev_to_dev(wimax_dev);
void *msg = skb->data; void *msg = skb->data;
size_t size = skb->len; size_t size = skb->len;
might_sleep(); might_sleep();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment