Compaq AA-RNG2A-TE Network Card User Manual


 
4 If the 3Com 3C5x9 device is running, calls the el_reset_locked( )
routine to restart the network interface with the new address.
5 Calls the simple_unlock( ) routine to release the simple lock for the
resource that is associated with el_softc_lock.
6 Calls the splx( ) routine to reset the CPU priority to the level that the
s variable specifies.
7 Sets the lock_on variable to 0 (false), which indicates that the simple
lock is no longer held.
8 If an IP address was configured, broadcasts an ARP packet to notify all
hosts that currently have this address in their ARP tables to update
their information.
9 Notifies the network layer about a possible change in the af_link
address.
12.8 Adding the Device to a Multicast Group
(SIOCADDMULTI ioctl Command)
The following code shows how the el_ioctl( ) routine implements the
SIOCADDMULTI ioctl command to add a multicast address:
case SIOCADDMULTI: 1
need_reset = 0;
if (bcmp(ifr->ifr_addr.sa_data, etherbroadcastaddr, 6) == 0) {
2
sc->is_broadcast++;
} else {
i = lan_add_multi(&sc->is_multi,
(unsigned char *)ifr->ifr_addr.sa_data);
switch (i) {
case LAN_MULTI_CHANGED:
if (sc->is_multi.lan_nmulti == 1)
3
need_reset++;
break;
case LAN_MULTI_NOT_CHANGED:
break;
case LAN_MULTI_FAILED:
default:
status = EINVAL;
break;
}
}
if ((ifp->if_flags & IFF_RUNNING) && (need_reset))
4
el_reset_locked(sc, ifp, unit);
if (sc->debug) {
j=0;
printf("el%d: Dump of multicast table after ADD (%d entries)\n",
unit, sc->is_multi.lan_nmulti);
for (i=0; i<sc->is_multi.lan_nmulti; i++) {
unsigned char *maddr;
LAN_GET_MULTI(&sc->is_multi, maddr, j);
printf(" %d %s (muse==%d)\n", i+1,
126 Implementing the ioctl Section