revert between 56095 -> 55830 in arch
[AROS.git] / workbench / devs / networks / pcnet32 / handler.c
blob7cb2d87c61dcced2b7ddc1ac2d3c6f54ecbb35fe
1 /*
2 * $Id$
3 */
5 /*
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 MA 02111-1307, USA.
22 #include <string.h>
24 #include <exec/types.h>
25 #include <exec/resident.h>
26 #include <exec/io.h>
27 #include <exec/ports.h>
28 #include <exec/errors.h>
30 #include <devices/sana2.h>
31 #include <devices/sana2specialstats.h>
32 #include <devices/newstyle.h>
34 #include <utility/utility.h>
35 #include <utility/tagitem.h>
36 #include <utility/hooks.h>
38 #include <proto/exec.h>
39 #include <proto/dos.h>
40 #include <proto/battclock.h>
42 #include <stdlib.h>
44 #include "pcnet32.h"
45 #include "unit.h"
46 #include LC_LIBDEFS_FILE
48 #define KNOWN_EVENTS \
49 (S2EVENT_ERROR | S2EVENT_TX | S2EVENT_RX | S2EVENT_ONLINE \
50 | S2EVENT_OFFLINE | S2EVENT_BUFF | S2EVENT_HARDWARE | S2EVENT_SOFTWARE)
52 static BOOL CmdInvalid(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
53 static BOOL CmdRead(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
54 static BOOL CmdWrite(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
55 static BOOL CmdFlush(LIBBASETYPEPTR LIBBASE, struct IORequest *request);
56 static BOOL CmdS2DeviceQuery(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
57 static BOOL CmdGetStationAddress(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
58 static BOOL CmdConfigInterface(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
59 static BOOL CmdBroadcast(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
60 static BOOL CmdTrackType(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
61 static BOOL CmdUntrackType(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
62 static BOOL CmdGetTypeStats(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
63 static BOOL CmdGetGlobalStats(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
64 static BOOL CmdDeviceQuery(LIBBASETYPEPTR LIBBASE, struct IOStdReq *request);
65 static BOOL CmdOnEvent(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
66 static BOOL CmdReadOrphan(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
67 static BOOL CmdOnline(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
68 static BOOL CmdOffline(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
69 static BOOL CmdAddMulticastAddresses(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
70 static BOOL CmdDelMulticastAddresses(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
72 static const UWORD supported_commands[] =
74 CMD_READ,
75 CMD_WRITE,
76 CMD_FLUSH,
77 S2_DEVICEQUERY,
78 S2_GETSTATIONADDRESS,
79 S2_CONFIGINTERFACE,
80 S2_ADDMULTICASTADDRESS,
81 S2_DELMULTICASTADDRESS,
82 S2_MULTICAST,
83 S2_BROADCAST,
84 S2_TRACKTYPE,
85 S2_UNTRACKTYPE,
86 S2_GETTYPESTATS,
87 // S2_GETSPECIALSTATS,
88 S2_GETGLOBALSTATS,
89 S2_ONEVENT,
90 S2_READORPHAN,
91 S2_ONLINE,
92 S2_OFFLINE,
93 NSCMD_DEVICEQUERY,
94 S2_ADDMULTICASTADDRESSES,
95 S2_DELMULTICASTADDRESSES,
99 void handle_request(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
101 BOOL complete;
103 switch(request->ios2_Req.io_Command)
105 case CMD_READ:
106 complete = CmdRead(LIBBASE, request);
107 break;
109 case CMD_WRITE:
110 case S2_MULTICAST:
111 complete = CmdWrite(LIBBASE, request);
112 break;
114 case CMD_FLUSH:
115 complete = CmdFlush(LIBBASE, (struct IORequest *)request);
116 break;
118 case S2_DEVICEQUERY:
119 complete = CmdS2DeviceQuery(LIBBASE, request);
120 break;
122 case S2_GETSTATIONADDRESS:
123 complete = CmdGetStationAddress(LIBBASE, request);
124 break;
126 case S2_CONFIGINTERFACE:
127 complete = CmdConfigInterface(LIBBASE, request);
128 break;
130 case S2_BROADCAST:
131 complete = CmdBroadcast(LIBBASE, request);
132 break;
134 case S2_TRACKTYPE:
135 complete = CmdTrackType(LIBBASE, request);
136 break;
138 case S2_UNTRACKTYPE:
139 complete = CmdUntrackType(LIBBASE, request);
140 break;
142 case S2_GETTYPESTATS:
143 complete = CmdGetTypeStats(LIBBASE, request);
144 break;
146 case S2_GETGLOBALSTATS:
147 complete = CmdGetGlobalStats(LIBBASE, request);
148 break;
150 case S2_ONEVENT:
151 complete = CmdOnEvent(LIBBASE, request);
152 break;
154 case S2_READORPHAN:
155 complete = CmdReadOrphan(LIBBASE, request);
156 break;
158 case S2_ONLINE:
159 complete = CmdOnline(LIBBASE, request);
160 break;
162 case S2_OFFLINE:
163 complete = CmdOffline(LIBBASE, request);
164 break;
166 case S2_ADDMULTICASTADDRESS:
167 case S2_ADDMULTICASTADDRESSES:
168 complete = CmdAddMulticastAddresses(LIBBASE, request);
169 break;
171 case S2_DELMULTICASTADDRESS:
172 case S2_DELMULTICASTADDRESSES:
173 complete = CmdDelMulticastAddresses(LIBBASE, request);
174 break;
176 case NSCMD_DEVICEQUERY:
177 complete = CmdDeviceQuery(LIBBASE, (struct IOStdReq *)request);
178 break;
180 default:
181 complete = CmdInvalid(LIBBASE, request);
184 if(complete && (request->ios2_Req.io_Flags & IOF_QUICK) == 0)
185 ReplyMsg((APTR)request);
187 ReleaseSemaphore(&((struct PCN32Unit *)request->ios2_Req.io_Unit)->pcnu_unit_lock);
190 static BOOL CmdInvalid(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
192 request->ios2_Req.io_Error = IOERR_NOCMD;
193 request->ios2_WireError = S2WERR_GENERIC_ERROR;
195 return TRUE;
198 static BOOL CmdRead(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
200 struct PCN32Unit *unit;
201 struct Opener *opener;
202 BOOL complete = FALSE;
204 unit = (APTR)request->ios2_Req.io_Unit;
206 D(bug("%s: S2CmdRead()\n", unit->pcnu_name));
208 if((unit->pcnu_flags & IFF_UP) != 0)
210 opener = request->ios2_BufferManagement;
211 request->ios2_Req.io_Flags &= ~IOF_QUICK;
212 PutMsg(&opener->read_port, (struct Message *)request);
214 else
216 request->ios2_Req.io_Error = S2ERR_OUTOFSERVICE;
217 request->ios2_WireError = S2WERR_UNIT_OFFLINE;
218 complete = TRUE;
221 /* Return */
223 return complete;
226 static BOOL CmdWrite(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
228 struct PCN32Unit *unit;
229 BYTE error = 0;
230 ULONG wire_error = S2WERR_GENERIC_ERROR;
231 BOOL complete = FALSE;
233 /* Check request is valid */
235 unit = (APTR)request->ios2_Req.io_Unit;
237 D(bug("%s: S2CmdWrite()\n", unit->pcnu_name));
239 if((unit->pcnu_flags & IFF_UP) == 0)
241 error = S2ERR_OUTOFSERVICE;
242 wire_error = S2WERR_UNIT_OFFLINE;
244 else if((request->ios2_Req.io_Command == S2_MULTICAST) &&
245 ((request->ios2_DstAddr[0] & 0x1) == 0))
247 error = S2ERR_BAD_ADDRESS;
248 wire_error = S2WERR_BAD_MULTICAST;
251 /* Queue request for sending */
253 if(error == 0) {
254 request->ios2_Req.io_Flags &= ~IOF_QUICK;
255 PutMsg(unit->pcnu_request_ports[WRITE_QUEUE], (APTR)request);
257 else
259 request->ios2_Req.io_Error = error;
260 request->ios2_WireError = wire_error;
261 complete = TRUE;
264 /* Return */
266 return complete;
269 static BOOL CmdFlush(LIBBASETYPEPTR LIBBASE, struct IORequest *request)
271 FlushUnit(LIBBASE, (APTR)request->io_Unit, EVENT_QUEUE, IOERR_ABORTED);
272 return TRUE;
275 static BOOL CmdS2DeviceQuery(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
277 D(struct PCN32Unit *unit = (APTR)request->ios2_Req.io_Unit);
278 // struct fe_priv *np = unit->pcnu_fe_priv;
279 struct Sana2DeviceQuery *info;
280 ULONG size_available, size;
282 D(bug("%s: S2CmdDeviceQuery()\n", unit->pcnu_name));
284 /* Copy device info */
286 info = request->ios2_StatData;
287 size = size_available = info->SizeAvailable;
288 if(size > sizeof(struct Sana2DeviceQuery))
289 size = sizeof(struct Sana2DeviceQuery);
291 CopyMem(&LIBBASE->pcnb_Sana2Info, info, size);
293 info->BPS = 100000000;
294 info->MTU = ETH_MTU;
295 info->HardwareType = S2WireType_Ethernet;
296 info->SizeAvailable = size_available;
297 info->SizeSupplied = size;
299 /* Return */
301 return TRUE;
304 static BOOL CmdGetStationAddress(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
306 struct PCN32Unit *unit;
308 /* Copy addresses */
310 unit = (APTR)request->ios2_Req.io_Unit;
312 D(bug("%s: S2CmdGetStationAddress()\n", unit->pcnu_name));
314 CopyMem(unit->pcnu_dev_addr, request->ios2_SrcAddr, ETH_ADDRESSSIZE);
315 CopyMem(unit->pcnu_org_addr, request->ios2_DstAddr, ETH_ADDRESSSIZE);
317 /* Return */
319 return TRUE;
322 static BOOL CmdConfigInterface(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
324 struct PCN32Unit *unit;
326 /* Configure adapter */
328 unit = (APTR)request->ios2_Req.io_Unit;
330 D(bug("%s: S2CmdConfigInterface()\n", unit->pcnu_name));
332 if((unit->pcnu_flags & IFF_CONFIGURED) == 0)
334 CopyMem(request->ios2_SrcAddr, unit->pcnu_dev_addr, ETH_ADDRESSSIZE);
335 unit->set_mac_address(unit);
336 unit->pcnu_flags |= IFF_CONFIGURED;
338 else
340 request->ios2_Req.io_Error = S2ERR_BAD_STATE;
341 request->ios2_WireError = S2WERR_IS_CONFIGURED;
344 /* Return */
346 return TRUE;
349 static BOOL CmdBroadcast(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
351 /* Fill in the broadcast address as destination */
353 memset(request->ios2_DstAddr, 0xff, 6);
355 /* Queue the write as normal */
357 return CmdWrite(LIBBASE, request);
360 static BOOL CmdTrackType(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
362 struct PCN32Unit *unit;
363 struct Opener *opener;
364 ULONG packet_type, wire_error=0;
365 struct TypeTracker *tracker;
366 struct TypeStats *initial_stats;
367 BYTE error = 0;
369 unit = (APTR)request->ios2_Req.io_Unit;
371 D(bug("%s: S2CmdTrackType()\n", unit->pcnu_name));
373 packet_type = request->ios2_PacketType;
375 /* Get global tracker */
377 tracker = (struct TypeTracker *)
378 FindTypeStats(LIBBASE, unit, &unit->pcnu_type_trackers, packet_type);
380 if(tracker != NULL)
381 tracker->user_count++;
382 else
384 tracker =
385 AllocMem(sizeof(struct TypeTracker), MEMF_PUBLIC|MEMF_CLEAR);
386 if(tracker != NULL)
388 tracker->packet_type = packet_type;
389 tracker->user_count = 1;
391 Disable();
392 AddTail((APTR)&unit->pcnu_type_trackers, (APTR)tracker);
393 Enable();
397 /* Store initial figures for this opener */
399 opener = request->ios2_BufferManagement;
400 initial_stats = FindTypeStats(LIBBASE, unit, &opener->initial_stats, packet_type);
402 if(initial_stats != NULL)
404 error = S2ERR_BAD_STATE;
405 wire_error = S2WERR_ALREADY_TRACKED;
408 if(error == 0)
410 initial_stats = AllocMem(sizeof(struct TypeStats), MEMF_PUBLIC);
411 if(initial_stats == NULL)
413 error = S2ERR_NO_RESOURCES;
414 wire_error = S2WERR_GENERIC_ERROR;
418 if(error == 0)
420 CopyMem(tracker, initial_stats, sizeof(struct TypeStats));
421 AddTail((APTR)&opener->initial_stats, (APTR)initial_stats);
424 /* Return */
426 request->ios2_Req.io_Error = error;
427 request->ios2_WireError = wire_error;
428 return TRUE;
431 static BOOL CmdUntrackType(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
433 struct PCN32Unit *unit;
434 struct Opener *opener;
435 ULONG packet_type;
436 struct TypeTracker *tracker;
437 struct TypeStats *initial_stats;
439 unit = (APTR)request->ios2_Req.io_Unit;
441 D(bug("%s: S2CmdUntrackType()\n", unit->pcnu_name));
443 packet_type = request->ios2_PacketType;
445 /* Get global tracker and initial figures */
447 tracker = (struct TypeTracker *)
448 FindTypeStats(LIBBASE, unit, &unit->pcnu_type_trackers, packet_type);
449 opener = request->ios2_BufferManagement;
450 initial_stats = FindTypeStats(LIBBASE, unit, &opener->initial_stats, packet_type);
452 /* Decrement tracker usage and free unused structures */
454 if(initial_stats != NULL)
456 if((--tracker->user_count) == 0)
458 Disable();
459 Remove((APTR)tracker);
460 Enable();
461 FreeMem(tracker, sizeof(struct TypeTracker));
464 Remove((APTR)initial_stats);
465 FreeMem(initial_stats, sizeof(struct TypeStats));
467 else
469 request->ios2_Req.io_Error = S2ERR_BAD_STATE;
470 request->ios2_WireError = S2WERR_NOT_TRACKED;
473 /* Return */
475 return TRUE;
478 static BOOL CmdGetTypeStats(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
480 struct PCN32Unit *unit;
481 struct Opener *opener;
482 ULONG packet_type;
483 struct TypeStats *initial_stats, *tracker;
484 struct Sana2PacketTypeStats *stats;
486 unit = (APTR)request->ios2_Req.io_Unit;
488 D(bug("%s: S2CmdGetTypeStats()\n", unit->pcnu_name));
490 packet_type = request->ios2_PacketType;
492 /* Get global tracker and initial figures */
494 tracker = FindTypeStats(LIBBASE, unit, &unit->pcnu_type_trackers, packet_type);
495 opener = request->ios2_BufferManagement;
496 initial_stats = FindTypeStats(LIBBASE, unit, &opener->initial_stats, packet_type);
498 /* Copy and adjust figures */
499 if(initial_stats != NULL)
501 stats = request->ios2_StatData;
502 CopyMem(&tracker->stats, stats, sizeof(struct Sana2PacketTypeStats));
503 stats->PacketsSent -= initial_stats->stats.PacketsSent;
504 stats->PacketsReceived -= initial_stats->stats.PacketsReceived;
505 stats->BytesSent -= initial_stats->stats.BytesSent;
506 stats->BytesReceived -= initial_stats->stats.BytesReceived;
507 stats->PacketsDropped -= initial_stats->stats.PacketsDropped;
509 else
511 request->ios2_Req.io_Error = S2ERR_BAD_STATE;
512 request->ios2_WireError = S2WERR_NOT_TRACKED;
515 /* Return */
517 return TRUE;
520 static BOOL CmdGetGlobalStats(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
522 struct PCN32Unit *unit;
524 /* Update and copy stats */
526 unit = (APTR)request->ios2_Req.io_Unit;
528 D(bug("%s: S2CmdGetGlobalStats()\n", unit->pcnu_name));
530 CopyMem(&unit->pcnu_stats, request->ios2_StatData,
531 sizeof(struct Sana2DeviceStats));
533 /* Return */
535 return TRUE;
538 static BOOL CmdDeviceQuery(LIBBASETYPEPTR LIBBASE, struct IOStdReq *request)
540 struct NSDeviceQueryResult *info;
542 /* Set structure size twice */
544 info = request->io_Data;
545 request->io_Actual = info->SizeAvailable =
546 offsetof(struct NSDeviceQueryResult, SupportedCommands) + sizeof(APTR);
548 /* Report device details */
550 info->DeviceType = NSDEVTYPE_SANA2;
551 info->DeviceSubType = 0;
553 info->SupportedCommands = (APTR)supported_commands;
555 /* Return */
557 return TRUE;
560 static BOOL CmdOnEvent(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
562 struct PCN32Unit *unit;
563 ULONG events, wanted_events;
564 BOOL complete = FALSE;
566 /* Check if we understand the event types */
568 unit = (APTR)request->ios2_Req.io_Unit;
570 D(bug("%s: S2CmdOnEvent()\n", unit->pcnu_name));
572 wanted_events = request->ios2_WireError;
573 if((wanted_events & ~KNOWN_EVENTS) != 0)
575 request->ios2_Req.io_Error = S2ERR_NOT_SUPPORTED;
576 events = S2WERR_BAD_EVENT;
578 else
580 if((unit->pcnu_flags & IFF_UP) != 0)
581 events = S2EVENT_ONLINE;
582 else
583 events = S2EVENT_OFFLINE;
585 events &= wanted_events;
588 /* Reply request if a wanted event has already occurred */
590 if(events != 0)
592 request->ios2_WireError = events;
593 complete = TRUE;
595 else
597 request->ios2_Req.io_Flags &= ~IOF_QUICK;
598 PutMsg(unit->pcnu_request_ports[EVENT_QUEUE], (APTR)request);
601 /* Return */
603 return complete;
606 static BOOL CmdReadOrphan(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
608 struct PCN32Unit *unit;
609 BYTE error = 0;
610 ULONG wire_error;
611 BOOL complete = FALSE;
613 /* Check request is valid */
615 unit = (APTR)request->ios2_Req.io_Unit;
616 D(bug("%s: S2CmdReadOrphan()\n", unit->pcnu_name));
618 if((unit->pcnu_flags & IFF_UP) == 0)
620 error = S2ERR_OUTOFSERVICE;
621 wire_error = S2WERR_UNIT_OFFLINE;
624 /* Queue request */
626 if(error == 0)
628 request->ios2_Req.io_Flags &= ~IOF_QUICK;
629 PutMsg(unit->pcnu_request_ports[ADOPT_QUEUE], (struct Message *)request);
631 else
633 request->ios2_Req.io_Error = error;
634 request->ios2_WireError = wire_error;
635 complete = TRUE;
638 /* Return */
640 return complete;
643 static BOOL CmdOnline(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
645 struct PCN32Unit *unit = (struct PCN32Unit *)request->ios2_Req.io_Unit;
646 BYTE error = 0;
647 ULONG wire_error = 0;
648 UWORD i;
650 D(bug("%s: S2CmdOnline()\n", unit->pcnu_name));
652 /* Check request is valid */
653 if((unit->pcnu_flags & IFF_CONFIGURED) == 0)
655 error = S2ERR_BAD_STATE;
656 wire_error = S2WERR_NOT_CONFIGURED;
659 /* Clear global and special stats and put adapter back online */
661 if((error == 0) && ((unit->pcnu_flags & IFF_UP) == 0))
663 unit->pcnu_stats.PacketsReceived = 0;
664 unit->pcnu_stats.PacketsSent = 0;
665 unit->pcnu_stats.BadData = 0;
666 unit->pcnu_stats.Overruns = 0;
667 unit->pcnu_stats.UnknownTypesReceived = 0;
668 unit->pcnu_stats.Reconfigurations = 0;
670 for(i = 0; i < STAT_COUNT; i++)
671 unit->pcnu_special_stats[i] = 0;
673 if (unit->start(unit))
675 error = S2ERR_OUTOFSERVICE;
676 wire_error = S2WERR_GENERIC_ERROR;
680 /* Return */
682 request->ios2_Req.io_Error = error;
683 request->ios2_WireError = wire_error;
684 return TRUE;
687 static BOOL CmdOffline(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
689 struct PCN32Unit *unit;
691 /* Put adapter offline */
693 unit = (APTR)request->ios2_Req.io_Unit;
695 D(bug("%s: S2CmdOffline()\n", unit->pcnu_name));
697 if((unit->pcnu_flags & IFF_UP) != 0)
698 unit->stop(unit);
700 /* Return */
701 return TRUE;
704 static BOOL CmdAddMulticastAddresses(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
706 struct PCN32Unit *unit;
707 UBYTE *lower_bound, *upper_bound;
709 unit = (APTR)request->ios2_Req.io_Unit;
711 D(bug("%s: S2CmdAddMulticastAddresses()\n", unit->pcnu_name));
713 lower_bound = request->ios2_SrcAddr;
714 if(request->ios2_Req.io_Command == S2_ADDMULTICASTADDRESS)
715 upper_bound = lower_bound;
716 else
717 upper_bound = request->ios2_DstAddr;
719 if(!AddMulticastRange(LIBBASE, unit, lower_bound, upper_bound))
721 request->ios2_Req.io_Error = S2ERR_NO_RESOURCES;
722 request->ios2_WireError = S2WERR_GENERIC_ERROR;
725 /* Return */
727 return TRUE;
730 static BOOL CmdDelMulticastAddresses(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
732 struct PCN32Unit *unit;
733 UBYTE *lower_bound, *upper_bound;
735 unit = (APTR)request->ios2_Req.io_Unit;
737 D(bug("%s: S2CmdDelMulticastAddresses()\n", unit->pcnu_name));
739 lower_bound = request->ios2_SrcAddr;
740 if(request->ios2_Req.io_Command == S2_DELMULTICASTADDRESS)
741 upper_bound = lower_bound;
742 else
743 upper_bound = request->ios2_DstAddr;
745 if(!RemMulticastRange(LIBBASE, unit, lower_bound, upper_bound))
747 request->ios2_Req.io_Error = S2ERR_BAD_STATE;
748 request->ios2_WireError = S2WERR_BAD_MULTICAST;
751 /* Return */
753 return TRUE;