November 24, 2024, 07:31:43 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: NIC Driver Installation:How to compile module for it?  (Read 7172 times)

Offline Ujjwol

  • Linux Learner
  • ***
  • Posts: 54
NIC Driver Installation:How to compile module for it?
« on: November 05, 2007, 05:28:40 PM »
I have recently brought a NIC Card and the driver file i got was
 readme.txt                This file.
    sc92031.c                 The linux core driver source code file
    Makefile                  Makefile for generating driver object file
and i have attached the readme file here..
-Start of ReadMe File------------------------------------------------------------------
*************************************************
**   Silan SC92031 PCI  Fast Ethernet Adapter  **
**                                             **
**   LINUX driver                              **
*************************************************

Introduction:
=============

    The instructions are for linux driver installation. You must
    compile the source code to generate sc92031.o and use insmod command to
    insert sc92031.o as module.

Contents of the Subdirectory:
=============================

    readme.txt                This file.
    sc92031.c                 The linux core driver source code file
    Makefile                  Makefile for generating driver object file
   
Kernel Supported
================
    This driver support linux kernel version 2.4.x/2.5.x now.

Installation
============
    1) Create a temporary directory:
        # mkdir /temp

    2) Change to the temporary directory:
        #cd /temp

    3) Copy driver (sl_linux.tgz) from CD-ROM to the temporary directory, and follow the commands:
       # mount -t iso9660 /dev/cdrom /mnt
       # cp /mnt/sl_linux.tgz /temp

    4) untar the archive file:
       # tar xzvf sl_linux.tgz
       # cd sc92031
   
    5) Compile the driver source files and it will generate sc92031.o, and
       copy it to correct driver installation path (The installation directory
       is different in different kernel versions. In 2.4.x kernel, the path is
       /lib/modules/KERNEL_VERSION/kernel/drivers/net/, and in 2.2.x kernel,
       the path is /lib/modules/KERNEL_VERSION/net/)
       # make install

    6) Check configuration file (/etc/modules.conf or /etc/conf.modules,it
       depend on your Linux distribution) for loading kernel modules. Make sure
       there is the following content in the configuration file, where # is
       interface number :
        alias eth# sc92031
 
    7) Reboot now:
        shutdown -r now

    8) Install your driver module (If the driver module is in the wrong place,
       an error message will appear, and say that can't find the driver
       module):
        insmod sc92031.o

    8) Use ifconfig command to assign the IP address, where # is network
       interface number:
        ifconfig eth# <IP>

    9) Check the interface works:
        ping <remote_host_IP>

Uninstallation
==============
    Please enter the following commands to uninstall your driver:
      # make uninstall

Module Parameter:
=================
The following parameters can be set when we install the driver module. You can add this parameters when
you execute 'insmod' command to install the driver
      # insmod sc92031.o  work_node =0x00

work_mode
  work_mode is used for setting the speed and duplex mode of NIC.Value is as followed:
        Autoselect 0x00
   M10-half   0x01
   M10-full   0x02
   M100-half  0x04
   M100-full  0x08
    
If you want to use other modes,it can be changed by the following steps:
        # ifdown eth0
        # rmmod sc92031
        # insmod sc92031.o work_mode= ****
---End of Readme File---------------------------------------------------------------------
 
 And the thing is,
 i cannot perform installation step 5 i.e, cannot produce sc92031.o from sc92031.c by compiling i don't know how :-(
 please anybody tell me how i going to do it..
 Thanks in Advance....
 and perform step 6 where to add in first /last ..
 I am confused..
 Ujjwol..
« Last Edit: November 05, 2007, 07:36:38 PM by Ricky »

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: Driver Installation
« Reply #1 on: November 05, 2007, 07:37:16 PM »
It is pretty simple, you need to create makefile and then make.
you see this link :
http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html , it has detailed instructions.

Offline Ujjwol

  • Linux Learner
  • ***
  • Posts: 54
Re: Driver Installation
« Reply #2 on: November 08, 2007, 01:32:22 AM »
It is pretty simple, you need to create makefile and then make.
you see this link :
http://www.cyberciti.biz/tips/compiling-linux-kernel-module.html , it has detailed instructions.
ya i did use the make file I got in the driver cd the compilation process displayes error
do i need to make makefile myself

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: NIC Driver Installation:How to compile module for it?
« Reply #3 on: November 08, 2007, 11:07:24 PM »
If it is in driver cd then you should use that one or try following as it is told in link I gave !