Compaq AA-RNG2A-TE Starting the Autosense Kernel Thread, Starting the Transmit of Pending Packets

Models: AA-RNG2A-TE

1 159
Download 159 pages 42.56 Kb
Page 111
Image 111

ifp->if_flags = IFF_RUNNING; 1

ifp->if_flags &= ~ IFF_OACTIVE;

2

1

2

Sets the IFF_RUNNING flag to mark the device as running.

Clears the IFF_OACTIVE flag to indicate that there is no output outstanding.

8.2.16 Starting the Autosense Kernel Thread

The following code shows how the el_init_locked( ) routine starts the autosense kernel thread. Only network device drivers that implement an autosense kernel thread perform this task.

if (sc->lm_media_mode == LAN_MODE_AUTOSENSE) {

1

sc->lm_media_state = LAN_MEDIA_STATE_SENSING;

thread_wakeup_one((vm_offset_t)&sc->autosense_flag);

}

1

If in autosense mode, starts the autosense kernel thread.

8.2.17 Starting the Transmit of Pending Packets

The following code shows how the el_init_locked( ) routine starts transmitting pending packets. Because el_init_locked( ) may have been called as a result of an error or a reset operation, it needs to examine its transmit queue for any pending transmit requests. If there are any, it starts transmitting them.

if (ifp->if_snd.ifq_head) 1 el_start_locked(sc, ifp);

return ESUCCESS;

}

2

1

2

If there are any pending packets, starts transmitting them by calling the el_start_locked( ) routine.

Returns ESUCCESS to the calling routine.

Implementing the Initialization Section 8–11

Page 111
Image 111
Compaq AA-RNG2A-TE manual Starting the Autosense Kernel Thread, Starting the Transmit of Pending Packets