[Prism54-devel] Just several thoughts & suggestions

kaleda kaleda@azuolas.org
Tue, 13 Jan 2004 12:54:09 +0200


Just several thougs on current prism54 driver architecture:

1. Private ioctls.
Currently there are 14 private ioctl's used. Total there are only 16
private ioctls available. If we'll continue this way - soon we'll have
no private ioctls.
What I suggest is to group similar functionality ioctls. E.g. group to
one ioctl all acl related ioctls, to other group all WPA related ioctls.
And so on. The card firmware has much more functionality, to fit each
function to separate ioctl. I can suggest two ways:
 1.a) still use iwpriv. But first byte (or several first bytes) shows
what kind of action to do: e.g. 1 - add new mac, 2 - delete mac, 3 -
list macs, and so on.
 1.b) write our own prism54 private ioctl tool. It should use private
ioctls, but in such a way we can use our private structures, and we can
much more extend functionality. We can give much more control to
userspace.

Everybody sees, that current wireless extentions & iwconfig
functionality is more than not enougth. And many wireless related things
are comming up (like wpa or acl - these are common things, but they have
no standard). I hope, that in near future wireless extentions will have
new features. When it'll happen  - of course we'll have to implement
them according new standarts. But at this time I think that having each
small feature in separate private ioctl is shortsighted.

I think 1.b variant is more flexible. 

2. mgt_set_* / mgt_get_*. I;d like to see these functions be public. So
anyone can call them from other files, so ioctl's code could be not only
in isl_ioctl.* files. It would be easy for people to write their own
specific needs ioctls in separate files, so the paches would be simpler.
It also would easy to separate ap & client functionality, as suggested
Jens Maurer.

3. Interface name. I'd like to have posibbility to set interface name
via module parameters. Some proprietary software are dumb enougth, that
they expect only specifin network interface names (like ixp0, ixp1 on
intel arm IXP architecture).

So much thougths & problems I see by now.
I'd like to hear your thoughts on these problems and discuss it. because
I see that problems 1 & 2 are very limiting drivers functionality.
I'm using this driver, but i removed all private ioctls from prism54
driver and instead of that I wrote my own ioctls (currently only 2
ioctls), which generally use common structure, like this:

<code>
struct specific_ioctl_strcut {
  // the oid to read/write/etc
  u32 oid;  

  // bitmask, which shows what to do with oid 
  // (set,get,set&get, more actions can follow)
  u8 action; 

  // here you can also add structure version checks,
  // pads to remain aligned, reserved for future fields, etc.

  // in this union thereis all structures from
  // isl_oid.h, that I want to set/get via this ioctl
  union UUU u;
};	//	struct specific_ioctl_strcut
</code>

In this way it's easy for me to extend some drivers ioctl's
functionality (just add a new case in switch in this ioctl nad
cpu_to_lexx conversion), and a simple way to extend private ioctl
utility - just add specific structure to union and add relates scanfs
(or whatsever).

And this way we can have functionality related ictls:
 - acl related ioctls
 - wpa and other encryption related ioctl
 - other general card settings ioctl

all the share common structure. All private ioctls are flexible, all can
be controlled from specific, lets say iwprism54 utility ;-)


So much comments and so few core
(quote from wireless tools header ;-).

Kaleda