Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Varka Bhadram <varkabhadram@gmail.com>
Cc: linux-wpan@vger.kernel.org, Varka Bhadram <varkab@cdac.in>
Subject: Re: [RFC bluetooth-next] mac802154: add description to mac802154 APIs
Date: Thu, 9 Apr 2015 14:05:57 +0200	[thread overview]
Message-ID: <20150409120556.GH1261@omega> (raw)
In-Reply-To: <552668E3.7060600@gmail.com>

On Thu, Apr 09, 2015 at 05:26:19PM +0530, Varka Bhadram wrote:
> On 04/09/2015 05:23 PM, Alexander Aring wrote:
> > On Thu, Apr 09, 2015 at 03:02:01PM +0530, Varka Bhadram wrote:
> >> Signed-off-by: Varka Bhadram <varkab@cdac.in>
> >> ---
> >>  include/net/mac802154.h |   95 ++++++++++++++++++++++++++++++++++++++++++++++-
> >>  1 file changed, 93 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/include/net/mac802154.h b/include/net/mac802154.h
> >> index e18e7fd..474dafb 100644
> >> --- a/include/net/mac802154.h
> >> +++ b/include/net/mac802154.h
> >> @@ -247,19 +247,110 @@ static inline void ieee802154_le64_to_be64(void *be64_dst, const void *le64_src)
> >>  	__put_unaligned_memmove64(swab64p(le64_src), be64_dst);
> >>  }
> >>  
> >> -/* Basic interface to register ieee802154 device */
> >> +/**
> >> + * ieee802154_alloc_hw - Allocate a new hardware device
> >> + *
> >> + * This must be called once for each hardware device. The returned pointer
> >> + * must be used to refer to this device when calling other functions.
> >> + * mac802154 allocates a private data area for the driver pointed to by
> >> + * @priv in &struct ieee802154_hw, the size of this area is given as
> >> + * @priv_data_len.
> >> + *
> >> + * @priv_data_len: length of private data
> >> + * @ops: callbacks for this device
> >> + *
> >> + * Return: A pointer to the new hardware device, or %NULL on error.
> >> + */
> >>  struct ieee802154_hw *
> >>  ieee802154_alloc_hw(size_t priv_data_len, const struct ieee802154_ops *ops);
> >> +
> >> +/**
> >> + * ieee802154_free_hw - free hardware descriptor
> >> + *
> >> + * This function frees everything that was allocated, including the
> >> + * private data for the driver. You must call ieee802154_unregister_hw()
> >> + * before calling this function.
> >> + *
> >> + * @hw: the hardware to free
> >> + */
> >>  void ieee802154_free_hw(struct ieee802154_hw *hw);
> >> +
> >> +/**
> >> + * ieee802154_register_hw - Register hardware device
> >> + *
> >> + * You must call this function before any other functions in
> >> + * mac802154. Note that before a hardware can be registered, you
> >> + * need to fill the contained wpan_phy's information.
> >> + *
> >> + * @hw: the device to register as returned by ieee802154_alloc_hw()
> >> + *
> >> + * Return: 0 on success. An error code otherwise.
> >> + */
> >>  int ieee802154_register_hw(struct ieee802154_hw *hw);
> >> +
> >> +/**
> >> + * ieee802154_unregister_hw - Unregister a hardware device
> >> + *
> >> + * This function instructs mac802154 to free allocated resources
> >> + * and unregister netdevices from the networking subsystem.
> >> + *
> >> + * @hw: the hardware to unregister
> >> + */
> >>  void ieee802154_unregister_hw(struct ieee802154_hw *hw);
> >>  
> >> +/**
> >> + * ieee802154_rx - receive frame
> >> + *
> >> + * Use this function to hand received frames to mac802154. The receive
> >> + * buffer in @skb must start with an IEEE 802.15.4 header. In case of a
> >> + * paged @skb is used, the driver is recommended to put the ieee802154
> >> + * header of the frame on the linear part of the @skb to avoid memory
> >> + * allocation and/or memcpy by the stack.
> >> + *
> >> + * This function may not be called in IRQ context. Calls to this function
> >> + * for a single hardware must be synchronized against each other.
> >> + *
> >> + * @hw: the hardware this frame came in on
> >> + * @skb: the buffer to receive, owned by mac802154 after this call
> >> + */
> >>  void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb);
> >> +
> >> +/**
> >> + * ieee802154_rx_irqsafe - receive frame
> >> + *
> >> + * Like ieee802154_rx() but can be called in IRQ context
> >> + * (internally defers to a tasklet.)
> >> + *
> >> + * @hw: the hardware this frame came in on
> >> + * @skb: the buffer to receive, owned by mac802154 after this call
> > missing lqi param description.
> 
> will do.
> 
> >> + */
> >>  void ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb,
> >>  			   u8 lqi);
> >> -
> >> +/**
> >> + * ieee802154_wake_queue - wake specific queue
> >> + * @hw: pointer as obtained from ieee802154_alloc_hw().
> >> + * @queue: queue number (counted from zero).
> >> + *
> > which specific queue? This have wireless only.
> 
> wake wireless queue.... Is OK? 
> 
> What do you suggest?

We don't have a queue parameter for this function. This is a copy&paste
issue from wireless code.

> 
> >> + * Drivers should use this function instead of netif_wake_queue.
> >> + */
> >>  void ieee802154_wake_queue(struct ieee802154_hw *hw);
> >> +
> >> +/**
> >> + * ieee802154_stop_queue - stop specific queue
> >> + * @hw: pointer as obtained from ieee802154_alloc_hw().
> >> + * @queue: queue number (counted from zero).
> >> + *
> > same here, we have no fancy multiple queues.
> 
> What do you suggest?
> 

Same here.

> >> + * Drivers should use this function instead of netif_stop_queue.
> >> + */
> >>  void ieee802154_stop_queue(struct ieee802154_hw *hw);
> >> +
> >> +/**
> >> + * ieee802154_xmit_complete - packet transmission complete
> >> + *
> >> + * @hw: pointer as obtained from ieee802154_alloc_hw().
> >> + * @skb: buffer for transmission
> >> + * @ifs_handling: indicate interframe space handling
> >> + */
> >>  void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb,
> >>  			      bool ifs_handling);

- Alex

  reply	other threads:[~2015-04-09 12:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09  9:32 [RFC bluetooth-next] mac802154: add description to mac802154 APIs Varka Bhadram
2015-04-09 11:53 ` Alexander Aring
2015-04-09 11:56   ` Varka Bhadram
2015-04-09 12:05     ` Alexander Aring [this message]
2015-04-09 12:14       ` Varka Bhadram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150409120556.GH1261@omega \
    --to=alex.aring@gmail.com \
    --cc=linux-wpan@vger.kernel.org \
    --cc=varkab@cdac.in \
    --cc=varkabhadram@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox