You are not logged in.

#1 2005-07-17 18:39:15

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Map wifi card to specific interface BUT...

the correct hardware address can only be found once the firmware has been loaded during an ifconfig interface up

as you udev starts first this is then kinda tricky - any ideas?

Offline

#2 2005-07-17 18:40:44

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: Map wifi card to specific interface BUT...

udev has hardware mask rules. I believe it gets it from somewhere other than ifconfig. wink


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2005-07-17 20:27:37

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Map wifi card to specific interface BUT...

which begs the question: where is that?

Offline

#4 2005-07-18 01:47:03

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Map wifi card to specific interface BUT...

I'm sure the firmware is loaded before an ifconfig interface up.

Offline

#5 2005-07-18 02:49:01

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: Map wifi card to specific interface BUT...


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#6 2005-07-18 04:13:44

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Map wifi card to specific interface BUT...

iphitus wrote:

I'm sure the firmware is loaded before an ifconfig interface up.

I'm almost certain it is not because i do not get any lights on the card until the first ifconfig up command - i could be wrong tho!

Offline

#7 2005-07-18 04:24:34

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Map wifi card to specific interface BUT...

Check your dmesg log. Usually it will make a message when it loads the firmware.

Offline

#8 2005-07-18 05:17:40

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Map wifi card to specific interface BUT...

it does - when i run the first ifconfig up command wink

Offline

#9 2005-07-18 05:43:40

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Map wifi card to specific interface BUT...

dibblethewrecker wrote:

it does - when i run the first ifconfig up command wink

That's...... wierd.

Offline

#10 2005-07-18 08:15:52

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Map wifi card to specific interface BUT...

yup! smile

Offline

#11 2005-07-18 20:14:24

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Map wifi card to specific interface BUT...

What kind of card is this (more info!) ?
How do you set it up during boot (using rc.conf,...) ?
Can you find any info about it under /sys ?
If this is PCI card you can identify it and write udev rule using pci id for example (man udev). MAC is not the only thing you can use in an udev rule.

Offline

#12 2005-07-18 20:21:44

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Map wifi card to specific interface BUT...

dibblethewrecker wrote:
iphitus wrote:

I'm sure the firmware is loaded before an ifconfig interface up.

I'm almost certain it is not because i do not get any lights on the card until the first ifconfig up command - i could be wrong tho!

woah... ummm mine lights up when I insmod/rmmod ... is it time to scour ifconfig source code? (doing it now... one sec)

edit
oddly enough ifconfig doesn't do much... it gets a FD for the interface and makes some ioctl calls on it... no firmware loading, use set's an "interface up" flag...

could be the module itself doing it, what's the module? I can check the source for that one...

Offline

#13 2005-07-18 20:44:26

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Map wifi card to specific interface BUT...

Firmware might be loaded by hotplug's firmware.agent.

Offline

#14 2005-07-18 20:51:31

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Map wifi card to specific interface BUT...

lanrat wrote:

Firmware might be loaded by hotplug's firmware.agent.

but I think dibble is saying he can load the module and wait for a whole day and no light, then type "ifconfig blark0 up" and the light comes on (implying firmware load)... if that's correct, then hotplug wouldn't have anything to do with it

Offline

#15 2005-07-18 20:54:18

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Map wifi card to specific interface BUT...

Why not ? If this generates some hotplug event like plugging cam or something... But we need more info about dibble's config.

Offline

#16 2005-07-18 21:00:20

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Map wifi card to specific interface BUT...

Anyway, if we figure out the whole process we could use udev to do it all in a few rules (using RUN maybe?).

Offline

#17 2005-07-18 22:31:23

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Map wifi card to specific interface BUT...

lanrat wrote:

Why not ? If this generates some hotplug event like plugging cam or something... But we need more info about dibble's config.

because ioctls don't regenerate events through udev - the device must already exist... udev doesn't do anything after that point (what would be the point in, say, udev picking up a "DMA turned on" event on a disk drive?)

Offline

#18 2005-07-19 00:15:32

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: Map wifi card to specific interface BUT...

I'll take a crack at this riddle.

Given you don't run hotplug and your module is not listed in your modules array in rc.conf,
and you have it aliased in modprobe.conf,
wouldn't that mean that the module is loaded the first time you try and access that interface?

The same thing occurs with any module that is aliased in modprobe.conf and not previously loaded, correct?


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#19 2005-07-19 10:33:05

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Map wifi card to specific interface BUT...

phrakture wrote:
lanrat wrote:

Firmware might be loaded by hotplug's firmware.agent.

but I think dibble is saying he can load the module and wait for a whole day and no light, then type "ifconfig blark0 up" and the light comes on (implying firmware load)... if that's correct, then hotplug wouldn't have anything to do with it

That's exactly it - i do think it is probably hotplug doing it tho but i don't know how.  The firmware for the card is stored in /lib/firmware which is where the Arch hotplug pkg looks so that seems like strong evidence.  In addition to this I do not load the module from rc.conf but it appears in lsmod.

I'm not using hotplug by the way.

I posted a load of info here originally about the problem:

http://bbs.archlinux.org/viewtopic.php? … highlight=

That contains a lot of config info.

Let me know what else you need smile

It's setup to start under my own custom wifi initscripts.

Offline

#20 2005-07-19 15:13:29

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Map wifi card to specific interface BUT...

wdemoss wrote:

I'll take a crack at this riddle.

Given you don't run hotplug and your module is not listed in your modules array in rc.conf,
and you have it aliased in modprobe.conf,
wouldn't that mean that the module is loaded the first time you try and access that interface?

The same thing occurs with any module that is aliased in modprobe.conf and not previously loaded, correct?

you may have something here - dibble, are you sure you're modprobing the module before hand? or are you just using "ifconfig <> up" and having *that* load the module?

Offline

#21 2005-07-19 15:20:25

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Map wifi card to specific interface BUT...

it's not aliased in modprobe.conf or listed in rc.conf - i can add it to rc.conf and see if that helps tho!

Offline

#22 2005-07-19 19:08:08

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Map wifi card to specific interface BUT...

That's a good idea :-)
It shouldn't matter that udev is loaded first. It just loads the rules. The real problem is how to identify this card. Is it visible under /sys ? (/sys/class/pcmcia/... ?).

BTW Which kernel are you using ?
http://kerneltrap.org/mailarchive/1/message/68282/flat

EDIT: What is your current udev rule for renaming this card?

Offline

#23 2005-07-19 20:29:11

dtw
Forum Fellow
From: London, UK
Registered: 2004-08-03
Posts: 4,428
Website

Re: Map wifi card to specific interface BUT...

I have no udev rule yet smile

The real problem is how to identify this card. Is it visible under /sys ? (/sys/class/pcmcia/... ?).

Not that I can see

Offline

#24 2005-07-19 23:29:51

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Map wifi card to specific interface BUT...

Udev doesnt handle networking devices.

Everyone is running hotplug now via udev. Do a pgrep hotplug and you will see that its running.

iphitus

Offline

#25 2005-07-20 21:07:54

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Map wifi card to specific interface BUT...

Yes, currently you're probably running firmware.agent via udev's hotplug rule (which is good).
It should be possible to convert all hotplug scripts to udev rules but the main problem is to rename the network interface based on some info from /sys or hotplug enviroment variables (if I understand you correctly).

Why don't you just try writing an udev rule like in this example?. Of course you need to first have the wireless card running.

It's important where you put the rule. If it's in your custom rules file named for example 00.udev.rules then it will be run before hotplug script and it's possible that it will not work.
In this case create a second file (if you don't want to modify standard rules) named for example x0.udev.rules and put this rule in there.
I don't have any experience with pcmcia wireless cards so I don't know if there are any rules in standard file that also have NAME filed and are related to pcmcia devices. Only one rule for a given device can have NAME field (every second rule is ignored).

BTW I hope you read the link I posted (about a possible bug in some kernel versions that doesn't allow renaming network interfaces via udev). If there is no bug I'm almost sure renaming your device via udev is possible. Writing udev rules is somethimes very tricky and time consuming though :-)

Offline

Board footer

Powered by FluxBB