From: Inaky Perez-Gonzalez <inaky@linux.intel.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 02/39] wimax: declarations for the in-kernel WiMAX API
Date: Mon, 24 Nov 2008 16:36:41 -0800 [thread overview]
Message-ID: <200811241636.42085.inaky@linux.intel.com> (raw)
In-Reply-To: <20081124161222.10927011@extreme>
On Monday 24 November 2008, Stephen Hemminger wrote:
> On Mon, 24 Nov 2008 15:43:33 -0800
>
> Inaky Perez-Gonzalez <inaky@linux.intel.com> wrote:
> > On Monday 24 November 2008, Stephen Hemminger wrote:
> > > On Mon, 24 Nov 2008 13:50:25 -0800
> > >
> > > Inaky Perez-Gonzalez <inaky@linux.intel.com> wrote:
> > > > [...snip...]
> > > > + */
> > > > +struct wimax_dev {
> > > > + struct net_device *net_dev;
> > > > + struct list_head id_table_node;
> > > > + struct list_head pipe_list;
> > > > + struct wimax_pipe *pipe_msg;
> > > > + struct mutex mutex; /* Protects all members and API calls */
> > > > + enum wimax_st state;
> > > > +
> > > > + int (*op_msg_from_user)(struct wimax_dev *wimax_dev,
> > > > + const void *, size_t,
> > > > + const struct genl_info *info);
> > > > + int (*op_rfkill_sw_toggle)(struct wimax_dev *wimax_dev,
> > > > + enum wimax_rf_state);
> > > > + int (*op_reset)(struct wimax_dev *wimax_dev);
> > >
> > > Move function pointers separate from data??
> >
> > Most devices will have only a single adapter, so I thought it was not
> > worth the overhead of the double dereference when average you will have a
> > single copy.
> >
> > > > + struct genl_family gnl_family;
> > >
> > > Isn't family for all of wimax not per device?
> >
> > Nope, it is per device. One generic netlink family per device (named
> > "WiMAX DEVICENAME").
> >
> > Makes it very easy in user and kernel space, no need for the overhead of
> > having an extra attribute for the destination interface.
> >
> > > > + struct rfkill *rfkill;
> > > > + struct input_dev *rfkill_input;
> > > > + unsigned rf_hw:1;
> > > > + unsigned rf_sw:1;
> > >
> > > don't bother with bitfield overhead make them u8
> >
> > sure
> >
> > > > + char name[32];
> > > > +};
> > >
> > > Why have name in this data structure? Do you handle network device
> > > renames properly?
> >
> > This is a physical name, not the network interface name (recommended name
> > in the members documentation is DRIVERNAME:physical path.
> >
> > The reason is it is used to register different things (rfkill device,
> > input device for rfkill, threads). It being tied to the physical path
> > makes it easy to map and not vulnerable to renames.
> >
> > Now it might be too short, that's another matter.
>
> Then shouldn't it be a 'struct device' and live in sysfs class hierarchy??
I am not sure I am following in the need for that.
In the case of the Intel device, it is a USB device, with the "primary node"
being a USB interface -- that is the parent of a 'struct device' that is the
netdev (wmx0).
But the name I am using for those things I need to register is the driver and
bus path name of the USB interface, as they cannot change.
If we dynamically rename the network ifname from wmx0 to myinterface, for
example, we won't be able to change the names of the different things were we
had to give a name (like rfkill, the rfkill associated input devices and the
kernel threads the driver needs). So we need a name that is not allowed to
change and still makes sense, ergo the physical path of the device.
That is only for internal kernel stuff, and some stuff will show in user
space:
$ cat /sys/class/net/wmx0/device/rfkill:rfkill1
i2400m-usb:5-2:1.0
but I think this is still better than showing "wmx0" after a rename from wmx0
to myinterfacename.
Maybe there is a way to permeate those name changes--if so, I am more than
happy to look into it if you could give me pointers; but still, would it be
worth the trouble?
Thanks,
And of course, we still
--
Inaky
next prev parent reply other threads:[~2008-11-25 0:42 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-24 21:50 [PATCH 00/39] merge request for WiMAX kernel stack and i2400m driver Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 01/39] wimax: documentation for the stack Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 02/39] wimax: declarations for the in-kernel WiMAX API Inaky Perez-Gonzalez
2008-11-24 22:33 ` Stephen Hemminger
2008-11-24 23:43 ` Inaky Perez-Gonzalez
2008-11-25 0:12 ` Stephen Hemminger
2008-11-25 0:36 ` Inaky Perez-Gonzalez [this message]
2008-11-24 21:50 ` [PATCH 03/39] wimax: constants and definitions to interact with user space Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 04/39] wimax: internal API for the kernel space WiMAX stack Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 05/39] wimax: debug macros and debug settings for the " Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 06/39] genetlink: export genl_unregister_mc_group() Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 07/39] wimax: generic WiMAX device management (registration, deregistration, etc) Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 08/39] wimax: Mappping of generic netlink family IDs to net devices Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 09/39] wimax: provides user space with information needed when opening a WiMAX device Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 10/39] wimax: Generic messaging interface between user space and driver/device Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 11/39] wimax: RF-kill framework integration Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 12/39] wimax: API call to reset a WiMAX device Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 13/39] wimax: Makefile, Kconfig and docbook linkage for the stack Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 14/39] i2400m: documentation and instructions for usage Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 15/39] i2400m: host-to-device protocol definitions Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 16/39] i2400m: core driver definitions and API Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 17/39] i2400m: Generic probe/disconnect, reset and message passing Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 18/39] i2400m: linkage to the networking stack Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 19/39] i2400m: sysfs controls Inaky Perez-Gonzalez
2008-11-26 22:07 ` Evgeniy Polyakov
2008-11-26 22:25 ` Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 20/39] i2400m: rfkill integration with the WiMAX stack Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 21/39] i2400m: firmware loading and bootrom initialization Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 22/39] i2400m: handling of the data/control reception path Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 23/39] i2400m: handling of the data/control transmission path Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 24/39] i2400m: various functions for device management Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 25/39] i2400m/USB: header for the USB bus driver Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 26/39] i2400m/USB: error density tracking Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 27/39] i2400m/USB: main probe/disconnect and backend routines Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 28/39] i2400m/USB: firmware upload backend Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 29/39] i2400m/USB: handling of notifications from the device Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 30/39] i2400m/USB: read transactions from the USB device Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 31/39] i2400m/USB: write transactions to " Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 32/39] i2400m/SDIO: header for the SDIO subdriver Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 33/39] i2400m/SDIO: main probe/disconnect and backend routines Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 34/39] i2400m/SDIO: firmware upload backend Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 35/39] i2400m/SDIO: read transactions from the SDIO device Inaky Perez-Gonzalez
2008-11-24 21:50 ` [PATCH 36/39] i2400m/SDIO: write transactions to " Inaky Perez-Gonzalez
2008-11-24 21:51 ` [PATCH 37/39] i2400m: Makefile and Kconfig Inaky Perez-Gonzalez
2008-11-24 21:51 ` [PATCH 38/39] wimax: export linux/wimax.h and linux/wimax-i2400m.h with headers_install Inaky Perez-Gonzalez
2008-11-24 21:51 ` [PATCH 39/39] wimax/i2400m: add CREDITS and MAINTAINERS entries Inaky Perez-Gonzalez
2008-11-25 8:47 ` [PATCH 00/39] merge request for WiMAX kernel stack and i2400m driver David Miller
2008-11-25 16:57 ` Inaky Perez-Gonzalez
2008-11-25 21:43 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2008-11-26 7:38 [PATCH 00/39] merge request for WiMAX kernel stack and i2400m driver v2 Inaky Perez-Gonzalez
2008-11-26 7:38 ` [PATCH 02/39] wimax: declarations for the in-kernel WiMAX API Inaky Perez-Gonzalez
2008-11-26 22:40 [PATCH 00/39] merge request for WiMAX kernel stack and i2400m driver v2 Inaky Perez-Gonzalez
2008-11-26 22:40 ` [PATCH 02/39] wimax: declarations for the in-kernel WiMAX API Inaky Perez-Gonzalez
2008-11-27 9:32 ` Johannes Berg
2008-12-03 2:07 ` Inaky Perez-Gonzalez
2008-12-04 9:04 ` Johannes Berg
2008-12-04 20:11 ` Inaky Perez-Gonzalez
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=200811241636.42085.inaky@linux.intel.com \
--to=inaky@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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;
as well as URLs for NNTP newsgroup(s).