Changeset 33fefc2 in rtems


Ignore:
Timestamp:
Mar 23, 1999, 11:17:52 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
33508cb
Parents:
e828c2d
Message:

Patch from Eric Norum to account for new routine that improved
parsing of interface names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/networking/driver.t

    re828c2d r33fefc2  
    135135@item ifp->if_name
    136136The name of the device.  The network stack uses this string
    137 and the device number for device name lookups.  The name should not
    138 contain digits as these will be assumed to be part of the unit number
    139 and not part of the device name.
    140 
     137and the device number for device name lookups.  The device name should
     138be obtained from the @code{name} entry in the configuration structure.
    141139
    142140@item ifp->if_unit
    143141The device number.  The network stack uses this number and the
    144142device name for device name lookups.  For example, if
    145 @code{ifp->if_name} is @samp{scc}, and @code{ifp->if_unit} is @samp{1},
    146 the full device name would be @samp{scc1}.
     143@code{ifp->if_name} is @samp{scc} and @code{ifp->if_unit} is @samp{1},
     144the full device name would be @samp{scc1}.  The unit number should be
     145obtained from the `name' entry in the configuration structure.
    147146
    148147@item ifp->if_mtu
     
    174173@end table
    175174
     175RTEMS provides a function to parse the driver name in the
     176configuration structure into a device name and unit number.
     177
     178@example
     179int rtems_bsdnet_parse_driver_name (
     180  const struct rtems_bsdnet_ifconfig *config,
     181  char **namep
     182);
     183@end example
     184
     185The function takes two arguments; a pointer to the configuration
     186structure and a pointer to a pointer to a character.  The function
     187parses the configuration name entry, allocates memory for the driver
     188name, places the driver name in this memory, sets the second argument
     189to point to the name and returns the unit number.
     190On error, a message is printed and -1 is returned.
     191
    176192Once the attach function  has set up the above entries it must link the
    177193driver data structure onto the list of devices by
     
    182198The attach function should return a non-zero value to indicate that
    183199the driver has been successfully configured and attached.
    184 
    185 
    186 
    187200
    188201@section Write the Driver Start Function.
Note: See TracChangeset for help on using the changeset viewer.