LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 08-11-2009, 12:57 PM   #1
zman2245
LQ Newbie
 
Registered: Mar 2009
Location: San Francisco, CA
Posts: 26

Rep: Reputation: 15
Naming interfaces within NIC driver


Hello:

I have been trying to create my own names for interfaces. I set the name just before registering a newly created netdevice object in the driver's probe routine. However, using a series of printk's I can see that another thread changes the names to the "standard" strings, e.g. eth0, eth1, eth2, etc.

I have found some userspace commands that are useful and should allow me to rename the interfaces, but I am still curious as to what is changing these names on me.

Code snippet from probe():

sprintf(netdev->name, "eth%d", eth_count);
err = register_netdev(netdev);
printk("NETDEV NAME: %s\n", netdev->name);
printk("NETDEV NAME: %s\n", netdev->name);


Where eth_count is a global that I initialize to 4 and increment. The first printk displays the name I set. The second one displays the "standardized" name!

Thanks,
Zack
 
Old 08-12-2009, 02:29 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Why don't you define an alias in the modprobe config file for the device?
ex:
Code:
/etc/modprobe.d/module-renames:alias    e1000-new       e1000
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Interfaces + Cisco 515 and default NIC streamalot Linux - Networking 0 06-12-2006 02:43 PM
Is there a way to have grub translate its own naming to naming scheme under Linux zhjim Linux - Software 6 05-28-2006 09:09 AM
Naming device driver Crunch *BSD 2 02-12-2005 11:46 AM
1 nic, 2 interfaces show up.. grcore Linux - Hardware 8 01-08-2005 02:46 PM
mail server the naming naming convention problem kashan Linux - Newbie 0 07-16-2004 03:08 PM


All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration