Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Newbie
Reload this Page Ethernet card set up conflicts
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Newbie If you're new to the wonderful world of Linux, start here!

Reply
 
Thread Tools Display Modes
Old 05-15-2003   #11 (permalink)
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,575
Oh, I see. I didn't think init_netdev would be a static function. A bit strange really, isn't it? Anyway, restore the old line there and do this change instead, then:

Original code:
Code:
	if (!(Adapter->net = init_etherdev(NULL, 0))) {
		MOD_DEC_USE_COUNT;
		kfree(Adapter);
		usb_dec_dev_use(dev);
		return NULL;
	}

	ether_setup(Adapter->net);
Change to (just one line added):
Code:
	if (!(Adapter->net = init_etherdev(NULL, 0))) {
		MOD_DEC_USE_COUNT;
		kfree(Adapter);
		usb_dec_dev_use(dev);
		return NULL;
	}
	dev_alloc_name(Adapter->net, "wlan%d");

	ether_setup(Adapter->net);
And yes, it is a little bit ugly, but so little that noone will notice. I wouldn't choose it as a permanent solution for the official driver code, of course, but IMHO it doesn't hurt here.
Dolda2000 is offline   Reply With Quote
Old 05-16-2003   #12 (permalink)
Just Joined!
 
Join Date: May 2003
Location: UK-Heart of Cheshire
Posts: 31
Over my head but I will give it a try.

Too many question to ask here like what is a symbol and what is a static function and what other type are there? (I am a newbie to c-got as far as comiling kernel-not jet to the error resolution stage and debug stage yet )
turls is offline   Reply With Quote
Old 05-16-2003   #13 (permalink)
Just Joined!
 
Join Date: May 2003
Location: UK-Heart of Cheshire
Posts: 31
What a star . Works fine once I had changed all the if settings!

Can you explain (in newbie language) what the code means and does (new to c but do have an understanding of programming)

Thanks
turls is offline   Reply With Quote
Old 05-16-2003   #14 (permalink)
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,575
I'm glad that it worked!

I'll try to answer some of the questions.
A symbol is basically a name for a memory address. The address can be for example a function or a variable. Say if a module wants to use a function in the kernel, it only has the function's name before it's loaded into the kernel. While the module is being into the kernel, all the symbol names are resolved to get the actual memory address at which the function resides, so that it can be called. If a symbol name can't be found in the kernel (such as was the case with init_netdev), it cannot be resolved, and therefore modprobe will return an error saying that there were unresolved symbols.
A static function in C is a function that exists and has a symbol, so that other functions in the same source file can use it. When the source file is compiled, however, the symbol isn't exported, so other soruce files can't use it. init_netdev is such a function; it's only used in the source file in which it exists. The reason that you would want to make a function static is that since the symbol won't be exported, other files can export that symbol instead. A certain symbol can only be exported once in the files that are linked together. Therefore, a static symbol doesn't take up space in the namespace.
I doubt that you get all of that, since I didn't really explain it very well. I'm not very good at explaining these things.

The difference that this code made is that it renames the network interface after it has been initialized. That's why I said it was a bit ugly. If I had done it properly, I would have made the module name the interface wlan0 directly instead of first naming it eth0 and then renaming it to wlan0. It's only that that would have taken many more lines of code.
Dolda2000 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 10:41 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0