Re: [PATCH 10/39] wimax: Generic messaging interface between user space and driver/device

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Inaky Perez-Gonzalez
Date: Tuesday, December 2, 2008 - 7:02 pm

On Thursday 27 November 2008, Thomas Graf wrote:

The number should not be a problem; the strange case is going to be the 
system that has more than one WiMAX interface.

So if the general case is going to be 1 interface, instead of making one
lookup for the family name and then another lookup for the attribute 
indicating the interface, making it one single lookup reduces the overhead.


the libnls I've seen don't define type NLA_BINARY -- I don't really know 
how they map onto each other, but using NLA_UNSPEC on both sides (kernel
and userspace) seems to work for transferring a buffer.


Note taken, thanks


So I am going to create a message, with no family specific payload
but just an attribute with a buffer sized 'size'. What should
I pass to it so it preallocates correctly? 

That construct (at least now) seems to work.


Fixed


This is mostly used before sending a message to user space, so genl_info 
doesn't apply. By default all notifications from the device are sent over
generic netlink to user space.

But some times we need to consume that information inside the kernel, so
instead of creating two separate formats, we just use the same. So we need
to extract, from an SKB that is packaged to be sent as generic netlink, 
the header. And at his point there is no genl_info :(

I've missed a couple that can get it from genl_info (in rfkill and msg), plus 
reset doesn't really needed. Updated them; the rest are contained in 
wimax_msg_data() and wimax_msg_len().


Good point; actually in most cases it either needs the pointer data
or both, so probably a wimax_msg_get_data_len() helper makes more sense.


Why? Should I just use NLA_BINARY then? What do I use in user space to compose
it if libnl still doesn't know about NLA_BINARY?

I just need it to verify that there is an attribute with a buffer. That's it.


So the policy is already set up like that, it has a pointer to the policy.
Are you saying it should be possible for me to just access genl_info->attrs[]?
[I didn't know that existed, just found out after your comment made me look
at it].

/me tries...

sweet, it works -- well, this cuts more code out, thanks.

-- 
Inaky

--
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 00/39] merge request for WiMAX kernel stack and i24 ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 01/39] wimax: documentation for the stack, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 02/39] wimax: declarations for the in-kernel WiMAX API, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 03/39] wimax: constants and definitions to interact ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 04/39] wimax: internal API for the kernel space WiM ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 05/39] wimax: debug macros and debug settings for t ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 06/39] genetlink: export genl_unregister_mc_group(), Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 07/39] wimax: generic WiMAX device management (regi ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 08/39] wimax: Mappping of generic netlink family ID ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 09/39] wimax: provides user space with information ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 10/39] wimax: Generic messaging interface between u ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 11/39] wimax: RF-kill framework integration, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 12/39] wimax: API call to reset a WiMAX device, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 13/39] wimax: Makefile, Kconfig and docbook linkage ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 14/39] i2400m: documentation and instructions for usage, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 15/39] i2400m: host-to-device protocol definitions, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 16/39] i2400m: core driver definitions and API, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 17/39] i2400m: Generic probe/disconnect, reset and ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 18/39] i2400m: linkage to the networking stack, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 19/39] i2400m: sysfs controls, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 20/39] i2400m: rfkill integration with the WiMAX stack, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 21/39] i2400m: firmware loading and bootrom initial ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 22/39] i2400m: handling of the data/control recepti ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 23/39] i2400m: handling of the data/control transmi ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 24/39] i2400m: various functions for device management, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 25/39] i2400m/USB: header for the USB bus driver, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 26/39] i2400m/USB: error density tracking, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 27/39] i2400m/USB: main probe/disconnect and backen ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 28/39] i2400m/USB: firmware upload backend, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 29/39] i2400m/USB: handling of notifications from t ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 30/39] i2400m/USB: read transactions from the USB d ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 31/39] i2400m/USB: write transactions to the USB device, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 32/39] i2400m/SDIO: header for the SDIO subdriver, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 33/39] i2400m/SDIO: main probe/disconnect and backe ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 34/39] i2400m/SDIO: firmware upload backend, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 35/39] i2400m/SDIO: read transactions from the SDIO ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 36/39] i2400m/SDIO: write transactions to the SDIO ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 37/39] i2400m: Makefile and Kconfig, Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 38/39] wimax: export linux/wimax.h and linux/wimax/ ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
[PATCH 39/39] wimax/i2400m: add CREDITS and MAINTAINERS en ..., Inaky Perez-Gonzalez, (Wed Nov 26, 3:40 pm)
Re: [PATCH 19/39] i2400m: sysfs controls, Johannes Berg, (Thu Nov 27, 2:23 am)
Re: [PATCH 00/39] merge request for WiMAX kernel stack and ..., Inaky Perez-Gonzalez, (Thu Nov 27, 2:24 am)
Re: [PATCH 01/39] wimax: documentation for the stack, Johannes Berg, (Thu Nov 27, 2:29 am)
Re: [PATCH 11/39] wimax: RF-kill framework integration, Johannes Berg, (Thu Nov 27, 2:56 am)
Re: [PATCH 12/39] wimax: API call to reset a WiMAX device, Johannes Berg, (Thu Nov 27, 2:58 am)
Re: [PATCH 00/39] merge request for WiMAX kernel stack and ..., Arkadiusz Miskiewicz, (Thu Nov 27, 3:18 am)
Re: [PATCH 00/39] merge request for WiMAX kernel stack and ..., Inaky Perez-Gonzalez, (Thu Nov 27, 9:51 am)
Re: [PATCH 10/39] wimax: Generic messaging interface betwe ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:02 pm)
Re: [PATCH 11/39] wimax: RF-kill framework integration, Inaky Perez-Gonzalez, (Tue Dec 2, 7:03 pm)
Re: [PATCH 12/39] wimax: API call to reset a WiMAX device, Inaky Perez-Gonzalez, (Tue Dec 2, 7:05 pm)
Re: [PATCH 03/39] wimax: constants and definitions to inte ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:06 pm)
Re: [PATCH 09/39] wimax: provides user space with informat ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:06 pm)
Re: [PATCH 07/39] wimax: generic WiMAX device management ( ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:06 pm)
Re: [PATCH 08/39] wimax: Mappping of generic netlink famil ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:06 pm)
Re: [PATCH 14/39] i2400m: documentation and instructions f ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:06 pm)
Re: [PATCH 15/39] i2400m: host-to-device protocol definitions, Inaky Perez-Gonzalez, (Tue Dec 2, 7:06 pm)
Re: [PATCH 00/39] merge request for WiMAX kernel stack and ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:07 pm)
Re: [PATCH 02/39] wimax: declarations for the in-kernel Wi ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:07 pm)
Re: [PATCH 04/39] wimax: internal API for the kernel space ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:07 pm)
Re: [PATCH 05/39] wimax: debug macros and debug settings f ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:07 pm)
Re: [PATCH 01/39] wimax: documentation for the stack, Inaky Perez-Gonzalez, (Tue Dec 2, 7:07 pm)
Re: [PATCH 00/39] merge request for WiMAX kernel stack and ..., Inaky Perez-Gonzalez, (Tue Dec 2, 7:10 pm)
Re: [PATCH 00/39] merge request for WiMAX kernel stack and ..., Inaky Perez-Gonzalez, (Thu Dec 4, 12:21 pm)
Re: [PATCH 04/39] wimax: internal API for the kernel space ..., Inaky Perez-Gonzalez, (Thu Dec 4, 12:22 pm)
Re: [PATCH 02/39] wimax: declarations for the in-kernel Wi ..., Inaky Perez-Gonzalez, (Thu Dec 4, 1:11 pm)