Skip to contentSkip to conversation

WAN device configuration, again...

DISCUSSION Krzysztof Halasa 2 participants 3 messages Oct 28, 2009 – Oct 29, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I'm currently at final stages of "producing" two WAN drivers and there is one thing to solve: they have really complex options. It's no longer a V.35 with ca. 4 clock modes, a clock rate and few encodings etc. They need many options unique to each driver/board. I think I need a more capable interface to configure the devices than the current ioctl-based one.

I think of something:
- using netlink or similar interface
- with potentially unlimited "payload" size (data may be transfered in smaller packets)
- the "command" and "response" should be variable-length ASCII-based, instead of fixed structures. This way I don't have to duplicate all option handling in userspace, only the specific driver has to know about them.

Comments? Perhaps there is already an example?
Should I use something else?

I also thought about using /sys read/write calls, but I'm not sure it's a good idea.

Signature · 1 line
Krzysztof Halasa
#1 lore raw
Quoted 11 lines · Krzysztof Halasa

Hi,

I'm currently at final stages of "producing" two WAN drivers and there is one thing to solve: they have really complex options. It's no longer a V.35 with ca. 4 clock modes, a clock rate and few encodings etc. They need many options unique to each driver/board. I think I need a more capable interface to configure the devices than the current ioctl-based one.

I think of something:
- using netlink or similar interface

If you're doing a new config interface, I'd suggest netlink like the wireless guys did to replace WEXT with cfg80211. Using netlink makes your interface easily available from programs/libraries without having to screenscrape anything. If you want some advice on netlink API stuff, ask Johannes Berg.

Dan

Quoted 12 lines

- with potentially unlimited "payload" size (data may be transfered in smaller packets)
- the "command" and "response" should be variable-length ASCII-based, instead of fixed structures. This way I don't have to duplicate all option handling in userspace, only the specific driver has to know about them.

Comments? Perhaps there is already an example?
Should I use something else?

I also thought about using /sys read/write calls, but I'm not sure it's a good idea.

#2 lore raw
Quoted 8 lines · Dan Williams
Quoted 2 lines

I think of something:
- using netlink or similar interface

If you're doing a new config interface, I'd suggest netlink like the wireless guys did to replace WEXT with cfg80211. Using netlink makes your interface easily available from programs/libraries without having to screenscrape anything. If you want some advice on netlink API stuff, ask Johannes Berg.

Thanks for your mail. It seems I'll do it this way.

Signature · 1 line
Krzysztof Halasa