mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-wireless@vger.kernel.org, sfr@canb.auug.org.au,
	slapin@ossfans.org
Subject: Re: [PATCH 4/6] net: add NL802154 interface for configuration of 802.15.4 devices
Date: Thu, 04 Jun 2009 16:12:29 +0200	[thread overview]
Message-ID: <1244124749.22576.71.camel@johannes.local> (raw)
In-Reply-To: <20090603122744.GC20508@doriath.ww600.siemens.net>

[-- Attachment #1: Type: text/plain, Size: 2556 bytes --]

On Wed, 2009-06-03 at 16:27 +0400, Dmitry Eremin-Solenikov wrote:

> > > +/* commands */
> > > +/* REQ should be responded with CONF
> > > + * and INDIC with RESP
> > > + */
> > > +enum {
> > 
> > kernel-doc explaining the commands would be immensely helpful.
> 
> What explanations whould you like to see? These commands are described
> in the IEEE 802.15.4 standard.

Well, for example which arguments they require...

> > > +#ifdef __KERNEL__
> > > +struct net_device;
> > > +
> > > +int ieee802154_nl_assoc_indic(struct net_device *dev, struct ieee802154_addr *addr, u8 cap);
> > > +int ieee802154_nl_assoc_confirm(struct net_device *dev, u16 short_addr, u8 status);
> > > +int ieee802154_nl_disassoc_indic(struct net_device *dev, struct ieee802154_addr *addr, u8 reason);
> > > +int ieee802154_nl_disassoc_confirm(struct net_device *dev, u8 status);
> > > +int ieee802154_nl_scan_confirm(struct net_device *dev, u8 status, u8 scan_type, u32 unscanned,
> > > +		u8 *edl/*, struct list_head *pan_desc_list */);
> > > +int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid, u16 coord_addr); /* TODO */
> > > +#endif
> > 
> > Why not just use two header files, one in net/ and one in linux/?
> 
> What would you suggest to put into the linux/ header and what in the
> net/ one?

userspace vs. in-kernel separation

> > > +static int ieee802154_nl_put_failure(struct sk_buff *msg)
> > > +{
> > > +	void *hdr = genlmsg_data(NLMSG_DATA(msg->data)); /* XXX: nlh is right at the start of msg */
> > > +	genlmsg_cancel(msg, hdr);
> > > +	nlmsg_free(msg);
> > > +	return -ENOBUFS;
> > > +}
> > 
> > This seems weird.
> 
> Why?

Because it's strange to cancel then free?

> > > +static int ieee802154_associate_req(struct sk_buff *skb, struct genl_info *info)
> > > +{
> > > +	struct net_device *dev;
> > > +	struct ieee802154_addr addr;
> > > +	int ret = -EINVAL;
> > > +
> > > +	if (!info->attrs[IEEE802154_ATTR_CHANNEL]
> > > +	 || !info->attrs[IEEE802154_ATTR_COORD_PAN_ID]
> > > +	 || (!info->attrs[IEEE802154_ATTR_COORD_HW_ADDR] && !info->attrs[IEEE802154_ATTR_COORD_SHORT_ADDR])
> > > +	 || !info->attrs[IEEE802154_ATTR_CAPABILITY])
> > > +		return -EINVAL;
> > 
> > That's some odd coding style.
> 
> Could you please elaborate this? What seems odd to you?

if (X
    && Y)

vs

if (X &&
    Y)

where the latter is used for all other sources files in the kernel. Try
applying that to _all_ your patches while you rework the sources to fit
into 80 columns.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2009-06-04 14:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03  9:33 [MERGE REQUEST] IEEE 802.15.4 stack: generic parts Dmitry Eremin-Solenikov
2009-06-03  9:33 ` [PATCH 1/6] crc-itu-t: add bit-reversed calculation Dmitry Eremin-Solenikov
2009-06-03  9:33   ` [PATCH 2/6] Add constants for the ieee 802.15.4/ZigBee stack Dmitry Eremin-Solenikov
2009-06-03  9:33     ` [PATCH 3/6] net: add IEEE 802.15.4 socket family implementation Dmitry Eremin-Solenikov
2009-06-03  9:33       ` [PATCH 4/6] net: add NL802154 interface for configuration of 802.15.4 devices Dmitry Eremin-Solenikov
2009-06-03  9:33         ` [PATCH 5/6] ieee802154: add documentation about our stack Dmitry Eremin-Solenikov
2009-06-03  9:33           ` [PATCH 6/6] ieee802154: add simple HardMAC driver sample Dmitry Eremin-Solenikov
2009-06-03  9:39         ` [PATCH 4/6] net: add NL802154 interface for configuration of 802.15.4 devices Johannes Berg
2009-06-03 10:09           ` David Miller
2009-06-03 10:52             ` Dmitry Eremin-Solenikov
2009-06-03 11:05               ` Johannes Berg
2009-06-03 12:27                 ` Dmitry Eremin-Solenikov
2009-06-04 14:12                   ` Johannes Berg [this message]
2009-06-04 14:51                     ` Dmitry Eremin-Solenikov
2009-06-04 15:12                       ` Patrick McHardy
2009-06-04 15:14                         ` Dmitry Eremin-Solenikov
2009-06-04 15:15                           ` Patrick McHardy
2009-06-03 12:55                 ` Sergey Lapin
2009-06-03 14:21                   ` Patrick McHardy
2009-06-03 23:12                 ` Dmitry Eremin-Solenikov
2009-06-03 10:08     ` [PATCH 2/6] Add constants for the ieee 802.15.4/ZigBee stack David Miller
2009-06-03 10:51       ` Dmitry Eremin-Solenikov
2009-06-03 21:19         ` David Miller
2009-06-03 23:15           ` Dmitry Eremin-Solenikov
2009-06-04  0:49             ` David Miller
2009-06-03 12:43   ` [PATCH 1/6] crc-itu-t: add bit-reversed calculation Ben Hutchings
2009-06-03 12:48     ` Dmitry Eremin-Solenikov
2009-06-04  0:49     ` Dmitry Eremin-Solenikov
2009-06-21  8:29     ` Dmitry Eremin-Solenikov
2009-06-21 10:18       ` Ivo van Doorn

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=1244124749.22576.71.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=davem@davemloft.net \
    --cc=dbaryshkov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=slapin@ossfans.org \
    /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

all inboxes | Powered by JetHome®