From 4575c45c34d9f4d103410749a609ee6ba87db66a Mon Sep 17 00:00:00 2001 From: Inaky Perez-Gonzalez Date: Tue, 5 May 2009 21:05:16 -0700 Subject: [PATCH] --- yaml --- r: 150549 b: refs/heads/master c: 52a8d9630890f2289354d03e8751bf0eba2b3376 h: refs/heads/master i: 150547: 4e9643f24a6d0a4bef77bff685c947b3805a5e5f v: v3 --- [refs] | 2 +- trunk/net/wimax/op-msg.c | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 364f5b9a8883..5a503ebc1578 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 052991d7ac7f7b2c0319e6ccd2e8a48a71f2bd58 +refs/heads/master: 52a8d9630890f2289354d03e8751bf0eba2b3376 diff --git a/trunk/net/wimax/op-msg.c b/trunk/net/wimax/op-msg.c index 9ad4d893a566..d631a17186bc 100644 --- a/trunk/net/wimax/op-msg.c +++ b/trunk/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 @@ struct sk_buff *wimax_msg_alloc(struct wimax_dev *wimax_dev, 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();