[patch 2.6.31 06/10] wimax: document why wimax_msg_*() operations can be used in any state

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Inaky Perez-Gonzalez
Date: Wednesday, May 27, 2009 - 6:05 pm

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: Inaky Perez-Gonzalez <inaky@linux.intel.com>
---
 net/wimax/op-msg.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/net/wimax/op-msg.c b/net/wimax/op-msg.c
index 9ad4d89..d631a17 100644
--- a/net/wimax/op-msg.c
+++ b/net/wimax/op-msg.c
@@ -108,6 +108,12 @@
  * Don't use skb_push()/skb_pull()/skb_reserve() on the skb, as
  * wimax_msg_send() depends on skb->data being placed at the
  * 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,
 				const char *pipe_name,
@@ -115,7 +121,7 @@ struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev,
 				gfp_t gfp_flags)
 {
 	int result;
-	struct device *dev = wimax_dev->net_dev->dev.parent;
+	struct device *dev = wimax_dev_to_dev(wimax_dev);
 	size_t msg_size;
 	void *genl_msg;
 	struct sk_buff *skb;
@@ -161,7 +167,6 @@ error_genlmsg_put:
 error_new:
 	nlmsg_free(skb);
 	return ERR_PTR(result);
-
 }
 EXPORT_SYMBOL_GPL(wimax_msg_alloc);
 
@@ -256,10 +261,16 @@ EXPORT_SYMBOL_GPL(wimax_msg_len);
  * Don't use skb_push()/skb_pull()/skb_reserve() on the skb, as
  * wimax_msg_send() depends on skb->data being placed at the
  * 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)
 {
-	struct device *dev = wimax_dev->net_dev->dev.parent;
+	struct device *dev = wimax_dev_to_dev(wimax_dev);
 	void *msg = skb->data;
 	size_t size = skb->len;
 	might_sleep();
-- 
1.6.2.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 2.6.31 00/10] WiMAX pull request, Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 01/10] wimax/i2400m: generate fake source MA ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 02/10] wimax/i2400m: trace commands sent fro ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 03/10] wimax/i2400m: allow kernel commands t ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 04/10] wimax/i2400m: factor out 'state repor ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 05/10] wimax/i2400m: remove redundant readin ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 06/10] wimax: document why wimax_msg_*() ope ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 07/10] wimax/i2400m: sdio: set the block siz ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 08/10] wimax: Add netlink interface to get d ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 09/10] wimax/i2400m: usb: fix device reset o ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
[patch 2.6.31 10/10] wimax: a new API call was added, incr ..., Inaky Perez-Gonzalez, (Wed May 27, 6:05 pm)
Re: [patch 2.6.31 08/10] wimax: Add netlink interface to g ..., Stephen Hemminger, (Wed May 27, 6:21 pm)
Re: [patch 2.6.31 08/10] wimax: Add netlink interface to g ..., Inaky Perez-Gonzalez, (Thu May 28, 9:16 am)
Re: [patch 2.6.31 08/10] wimax: Add netlink interface to g ..., Inaky Perez-Gonzalez, (Thu May 28, 3:09 pm)