Changeset 33fefc2 in rtems
- Timestamp:
- 03/23/99 23:17:52 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 33508cb
- Parents:
- e828c2dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/networking/driver.t
re828c2dd r33fefc2 135 135 @item ifp->if_name 136 136 The 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 137 and the device number for device name lookups. The device name should 138 be obtained from the @code{name} entry in the configuration structure. 141 139 142 140 @item ifp->if_unit 143 141 The device number. The network stack uses this number and the 144 142 device 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}, 144 the full device name would be @samp{scc1}. The unit number should be 145 obtained from the `name' entry in the configuration structure. 147 146 148 147 @item ifp->if_mtu … … 174 173 @end table 175 174 175 RTEMS provides a function to parse the driver name in the 176 configuration structure into a device name and unit number. 177 178 @example 179 int rtems_bsdnet_parse_driver_name ( 180 const struct rtems_bsdnet_ifconfig *config, 181 char **namep 182 ); 183 @end example 184 185 The function takes two arguments; a pointer to the configuration 186 structure and a pointer to a pointer to a character. The function 187 parses the configuration name entry, allocates memory for the driver 188 name, places the driver name in this memory, sets the second argument 189 to point to the name and returns the unit number. 190 On error, a message is printed and -1 is returned. 191 176 192 Once the attach function has set up the above entries it must link the 177 193 driver data structure onto the list of devices by … … 182 198 The attach function should return a non-zero value to indicate that 183 199 the driver has been successfully configured and attached. 184 185 186 187 200 188 201 @section Write the Driver Start Function.
Note: See TracChangeset
for help on using the changeset viewer.