Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / networks / via-rhine / handler.c
blobe9e79aa3bae3899b550bb85b579f1468932521f0
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 <exec/types.h>
23 #include <exec/resident.h>
24 #include <exec/io.h>
25 #include <exec/ports.h>
26 #include <exec/errors.h>
28 #include <devices/sana2.h>
29 #include <devices/sana2specialstats.h>
30 #include <devices/newstyle.h>
32 #include <utility/utility.h>
33 #include <utility/tagitem.h>
34 #include <utility/hooks.h>
36 #include <proto/exec.h>
37 #include <proto/dos.h>
38 #include <proto/battclock.h>
40 #include <stdlib.h>
42 #include "via-rhine.h"
43 #include "unit.h"
44 #include LC_LIBDEFS_FILE
46 #define KNOWN_EVENTS \
47 (S2EVENT_ERROR | S2EVENT_TX | S2EVENT_RX | S2EVENT_ONLINE \
48 | S2EVENT_OFFLINE | S2EVENT_BUFF | S2EVENT_HARDWARE | S2EVENT_SOFTWARE)
50 static BOOL CmdInvalid(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
51 static BOOL CmdRead(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
52 static BOOL CmdWrite(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
53 static BOOL CmdFlush(LIBBASETYPEPTR LIBBASE, struct IORequest *request);
54 static BOOL CmdS2DeviceQuery(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
55 static BOOL CmdGetStationAddress(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
56 static BOOL CmdConfigInterface(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
57 static BOOL CmdBroadcast(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
58 static BOOL CmdTrackType(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
59 static BOOL CmdUntrackType(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
60 static BOOL CmdGetTypeStats(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
61 static BOOL CmdGetGlobalStats(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
62 static BOOL CmdDeviceQuery(LIBBASETYPEPTR LIBBASE, struct IOStdReq *request);
63 static BOOL CmdOnEvent(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
64 static BOOL CmdReadOrphan(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
65 static BOOL CmdOnline(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
66 static BOOL CmdOffline(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
67 static BOOL CmdAddMulticastAddresses(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
68 static BOOL CmdDelMulticastAddresses(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request);
70 static const UWORD supported_commands[] =
72 CMD_READ,
73 CMD_WRITE,
74 CMD_FLUSH,
75 S2_DEVICEQUERY,
76 S2_GETSTATIONADDRESS,
77 S2_CONFIGINTERFACE,
78 S2_ADDMULTICASTADDRESS,
79 S2_DELMULTICASTADDRESS,
80 S2_MULTICAST,
81 S2_BROADCAST,
82 S2_TRACKTYPE,
83 S2_UNTRACKTYPE,
84 S2_GETTYPESTATS,
85 // S2_GETSPECIALSTATS,
86 S2_GETGLOBALSTATS,
87 S2_ONEVENT,
88 S2_READORPHAN,
89 S2_ONLINE,
90 S2_OFFLINE,
91 NSCMD_DEVICEQUERY,
92 S2_ADDMULTICASTADDRESSES,
93 S2_DELMULTICASTADDRESSES,
97 void handle_request(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
99 BOOL complete;
101 switch(request->ios2_Req.io_Command)
103 case CMD_READ:
104 complete = CmdRead(LIBBASE, request);
105 break;
107 case CMD_WRITE:
108 case S2_MULTICAST:
109 complete = CmdWrite(LIBBASE, request);
110 break;
112 case CMD_FLUSH:
113 complete = CmdFlush(LIBBASE, (struct IORequest *)request);
114 break;
116 case S2_DEVICEQUERY:
117 complete = CmdS2DeviceQuery(LIBBASE, request);
118 break;
120 case S2_GETSTATIONADDRESS:
121 complete = CmdGetStationAddress(LIBBASE, request);
122 break;
124 case S2_CONFIGINTERFACE:
125 complete = CmdConfigInterface(LIBBASE, request);
126 break;
128 case S2_BROADCAST:
129 complete = CmdBroadcast(LIBBASE, request);
130 break;
132 case S2_TRACKTYPE:
133 complete = CmdTrackType(LIBBASE, request);
134 break;
136 case S2_UNTRACKTYPE:
137 complete = CmdUntrackType(LIBBASE, request);
138 break;
140 case S2_GETTYPESTATS:
141 complete = CmdGetTypeStats(LIBBASE, request);
142 break;
144 case S2_GETGLOBALSTATS:
145 complete = CmdGetGlobalStats(LIBBASE, request);
146 break;
148 case S2_ONEVENT:
149 complete = CmdOnEvent(LIBBASE, request);
150 break;
152 case S2_READORPHAN:
153 complete = CmdReadOrphan(LIBBASE, request);
154 break;
156 case S2_ONLINE:
157 complete = CmdOnline(LIBBASE, request);
158 break;
160 case S2_OFFLINE:
161 complete = CmdOffline(LIBBASE, request);
162 break;
164 case S2_ADDMULTICASTADDRESS:
165 case S2_ADDMULTICASTADDRESSES:
166 complete = CmdAddMulticastAddresses(LIBBASE, request);
167 break;
169 case S2_DELMULTICASTADDRESS:
170 case S2_DELMULTICASTADDRESSES:
171 complete = CmdDelMulticastAddresses(LIBBASE, request);
172 break;
174 case NSCMD_DEVICEQUERY:
175 complete = CmdDeviceQuery(LIBBASE, (struct IOStdReq *)request);
176 break;
178 default:
179 complete = CmdInvalid(LIBBASE, request);
182 if(complete && (request->ios2_Req.io_Flags & IOF_QUICK) == 0)
183 ReplyMsg((APTR)request);
185 ReleaseSemaphore(&((struct VIARHINEUnit *)request->ios2_Req.io_Unit)->rhineu_unit_lock);
188 static BOOL CmdInvalid(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
190 request->ios2_Req.io_Error = IOERR_NOCMD;
191 request->ios2_WireError = S2WERR_GENERIC_ERROR;
193 return TRUE;
196 static BOOL CmdRead(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
198 struct VIARHINEUnit *unit;
199 struct Opener *opener;
200 BOOL complete = FALSE;
202 unit = (APTR)request->ios2_Req.io_Unit;
204 D(bug("%s: S2CmdRead()\n", unit->rhineu_name));
206 if((unit->rhineu_flags & IFF_UP) != 0)
208 opener = request->ios2_BufferManagement;
209 request->ios2_Req.io_Flags &= ~IOF_QUICK;
210 PutMsg(&opener->read_port, (struct Message *)request);
212 else
214 request->ios2_Req.io_Error = S2ERR_OUTOFSERVICE;
215 request->ios2_WireError = S2WERR_UNIT_OFFLINE;
216 complete = TRUE;
219 /* Return */
221 return complete;
224 static BOOL CmdWrite(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
226 struct VIARHINEUnit *unit;
227 BYTE error = 0;
228 ULONG wire_error = S2WERR_GENERIC_ERROR;
229 BOOL complete = FALSE;
231 /* Check request is valid */
233 unit = (APTR)request->ios2_Req.io_Unit;
235 D(bug("%s: S2CmdWrite()\n", unit->rhineu_name));
237 if((unit->rhineu_flags & IFF_UP) == 0)
239 error = S2ERR_OUTOFSERVICE;
240 wire_error = S2WERR_UNIT_OFFLINE;
242 else if((request->ios2_Req.io_Command == S2_MULTICAST) &&
243 ((request->ios2_DstAddr[0] & 0x1) == 0))
245 error = S2ERR_BAD_ADDRESS;
246 wire_error = S2WERR_BAD_MULTICAST;
249 /* Queue request for sending */
251 if(error == 0) {
252 request->ios2_Req.io_Flags &= ~IOF_QUICK;
253 PutMsg(unit->rhineu_request_ports[WRITE_QUEUE], (APTR)request);
255 else
257 request->ios2_Req.io_Error = error;
258 request->ios2_WireError = wire_error;
259 complete = TRUE;
262 /* Return */
264 return complete;
267 static BOOL CmdFlush(LIBBASETYPEPTR LIBBASE, struct IORequest *request)
269 FlushUnit(LIBBASE, (APTR)request->io_Unit, EVENT_QUEUE, IOERR_ABORTED);
270 return TRUE;
273 static BOOL CmdS2DeviceQuery(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
275 D(struct VIARHINEUnit *unit = (APTR)request->ios2_Req.io_Unit);
276 // struct fe_priv *np = unit->rhineu_fe_priv;
277 struct Sana2DeviceQuery *info;
278 ULONG size_available, size;
280 D(bug("%s: S2CmdDeviceQuery()\n", unit->rhineu_name));
282 /* Copy device info */
284 info = request->ios2_StatData;
285 size = size_available = info->SizeAvailable;
286 if(size > sizeof(struct Sana2DeviceQuery))
287 size = sizeof(struct Sana2DeviceQuery);
289 CopyMem(&LIBBASE->rhineb_Sana2Info, info, size);
291 info->BPS = 100000000;
292 info->MTU = ETH_MTU;
293 info->HardwareType = S2WireType_Ethernet;
294 info->SizeAvailable = size_available;
295 info->SizeSupplied = size;
297 /* Return */
299 return TRUE;
302 static BOOL CmdGetStationAddress(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
304 struct VIARHINEUnit *unit;
306 /* Copy addresses */
308 unit = (APTR)request->ios2_Req.io_Unit;
310 D(bug("%s: S2CmdGetStationAddress()\n", unit->rhineu_name));
312 CopyMem(unit->rhineu_dev_addr, request->ios2_SrcAddr, ETH_ADDRESSSIZE);
313 CopyMem(unit->rhineu_org_addr, request->ios2_DstAddr, ETH_ADDRESSSIZE);
315 /* Return */
317 return TRUE;
320 static BOOL CmdConfigInterface(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
322 struct VIARHINEUnit *unit;
324 /* Configure adapter */
326 unit = (APTR)request->ios2_Req.io_Unit;
328 D(bug("%s: S2CmdConfigInterface()\n", unit->rhineu_name));
330 if((unit->rhineu_flags & IFF_CONFIGURED) == 0)
332 CopyMem(request->ios2_SrcAddr, unit->rhineu_dev_addr, ETH_ADDRESSSIZE);
333 unit->set_mac_address(unit);
334 unit->rhineu_flags |= IFF_CONFIGURED;
336 else
338 request->ios2_Req.io_Error = S2ERR_BAD_STATE;
339 request->ios2_WireError = S2WERR_IS_CONFIGURED;
342 /* Return */
344 return TRUE;
347 static BOOL CmdBroadcast(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
349 /* Fill in the broadcast address as destination */
351 *((ULONG *)request->ios2_DstAddr) = 0xffffffff;
352 *((UWORD *)(request->ios2_DstAddr + 4)) = 0xffff;
354 /* Queue the write as normal */
356 return CmdWrite(LIBBASE, request);
359 static BOOL CmdTrackType(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
361 struct VIARHINEUnit *unit;
362 struct Opener *opener;
363 ULONG packet_type, wire_error=0;
364 struct TypeTracker *tracker;
365 struct TypeStats *initial_stats;
366 BYTE error = 0;
368 unit = (APTR)request->ios2_Req.io_Unit;
370 D(bug("%s: S2CmdTrackType()\n", unit->rhineu_name));
372 packet_type = request->ios2_PacketType;
374 /* Get global tracker */
376 tracker = (struct TypeTracker *)
377 FindTypeStats(LIBBASE, unit, &unit->rhineu_type_trackers, packet_type);
379 if(tracker != NULL)
380 tracker->user_count++;
381 else
383 tracker =
384 AllocMem(sizeof(struct TypeTracker), MEMF_PUBLIC|MEMF_CLEAR);
385 if(tracker != NULL)
387 tracker->packet_type = packet_type;
388 tracker->user_count = 1;
390 Disable();
391 AddTail((APTR)&unit->rhineu_type_trackers, (APTR)tracker);
392 Enable();
396 /* Store initial figures for this opener */
398 opener = request->ios2_BufferManagement;
399 initial_stats = FindTypeStats(LIBBASE, unit, &opener->initial_stats, packet_type);
401 if(initial_stats != NULL)
403 error = S2ERR_BAD_STATE;
404 wire_error = S2WERR_ALREADY_TRACKED;
407 if(error == 0)
409 initial_stats = AllocMem(sizeof(struct TypeStats), MEMF_PUBLIC);
410 if(initial_stats == NULL)
412 error = S2ERR_NO_RESOURCES;
413 wire_error = S2WERR_GENERIC_ERROR;
417 if(error == 0)
419 CopyMem(tracker, initial_stats, sizeof(struct TypeStats));
420 AddTail((APTR)&opener->initial_stats, (APTR)initial_stats);
423 /* Return */
425 request->ios2_Req.io_Error = error;
426 request->ios2_WireError = wire_error;
427 return TRUE;
430 static BOOL CmdUntrackType(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
432 struct VIARHINEUnit *unit;
433 struct Opener *opener;
434 ULONG packet_type;
435 struct TypeTracker *tracker;
436 struct TypeStats *initial_stats;
438 unit = (APTR)request->ios2_Req.io_Unit;
440 D(bug("%s: S2CmdUntrackType()\n", unit->rhineu_name));
442 packet_type = request->ios2_PacketType;
444 /* Get global tracker and initial figures */
446 tracker = (struct TypeTracker *)
447 FindTypeStats(LIBBASE, unit, &unit->rhineu_type_trackers, packet_type);
448 opener = request->ios2_BufferManagement;
449 initial_stats = FindTypeStats(LIBBASE, unit, &opener->initial_stats, packet_type);
451 /* Decrement tracker usage and free unused structures */
453 if(initial_stats != NULL)
455 if((--tracker->user_count) == 0)
457 Disable();
458 Remove((APTR)tracker);
459 Enable();
460 FreeMem(tracker, sizeof(struct TypeTracker));
463 Remove((APTR)initial_stats);
464 FreeMem(initial_stats, sizeof(struct TypeStats));
466 else
468 request->ios2_Req.io_Error = S2ERR_BAD_STATE;
469 request->ios2_WireError = S2WERR_NOT_TRACKED;
472 /* Return */
474 return TRUE;
477 static BOOL CmdGetTypeStats(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
479 struct VIARHINEUnit *unit;
480 struct Opener *opener;
481 ULONG packet_type;
482 struct TypeStats *initial_stats, *tracker;
483 struct Sana2PacketTypeStats *stats;
485 unit = (APTR)request->ios2_Req.io_Unit;
487 D(bug("%s: S2CmdGetTypeStats()\n", unit->rhineu_name));
489 packet_type = request->ios2_PacketType;
491 /* Get global tracker and initial figures */
493 tracker = FindTypeStats(LIBBASE, unit, &unit->rhineu_type_trackers, packet_type);
494 opener = request->ios2_BufferManagement;
495 initial_stats = FindTypeStats(LIBBASE, unit, &opener->initial_stats, packet_type);
497 /* Copy and adjust figures */
498 if(initial_stats != NULL)
500 stats = request->ios2_StatData;
501 CopyMem(&tracker->stats, stats, sizeof(struct Sana2PacketTypeStats));
502 stats->PacketsSent -= initial_stats->stats.PacketsSent;
503 stats->PacketsReceived -= initial_stats->stats.PacketsReceived;
504 stats->BytesSent -= initial_stats->stats.BytesSent;
505 stats->BytesReceived -= initial_stats->stats.BytesReceived;
506 stats->PacketsDropped -= initial_stats->stats.PacketsDropped;
508 else
510 request->ios2_Req.io_Error = S2ERR_BAD_STATE;
511 request->ios2_WireError = S2WERR_NOT_TRACKED;
514 /* Return */
516 return TRUE;
519 static BOOL CmdGetGlobalStats(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
521 struct VIARHINEUnit *unit;
523 /* Update and copy stats */
525 unit = (APTR)request->ios2_Req.io_Unit;
527 D(bug("%s: S2CmdGetGlobalStats()\n", unit->rhineu_name));
529 CopyMem(&unit->rhineu_stats, request->ios2_StatData,
530 sizeof(struct Sana2DeviceStats));
532 /* Return */
534 return TRUE;
537 static BOOL CmdDeviceQuery(LIBBASETYPEPTR LIBBASE, struct IOStdReq *request)
539 struct NSDeviceQueryResult *info;
541 /* Set structure size twice */
543 info = request->io_Data;
544 request->io_Actual = info->SizeAvailable =
545 offsetof(struct NSDeviceQueryResult, SupportedCommands) + sizeof(APTR);
547 /* Report device details */
549 info->DeviceType = NSDEVTYPE_SANA2;
550 info->DeviceSubType = 0;
552 info->SupportedCommands = (APTR)supported_commands;
554 /* Return */
556 return TRUE;
559 static BOOL CmdOnEvent(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
561 struct VIARHINEUnit *unit;
562 ULONG events, wanted_events;
563 BOOL complete = FALSE;
565 /* Check if we understand the event types */
567 unit = (APTR)request->ios2_Req.io_Unit;
569 D(bug("%s: S2CmdOnEvent()\n", unit->rhineu_name));
571 wanted_events = request->ios2_WireError;
572 if((wanted_events & ~KNOWN_EVENTS) != 0)
574 request->ios2_Req.io_Error = S2ERR_NOT_SUPPORTED;
575 events = S2WERR_BAD_EVENT;
577 else
579 if((unit->rhineu_flags & IFF_UP) != 0)
580 events = S2EVENT_ONLINE;
581 else
582 events = S2EVENT_OFFLINE;
584 events &= wanted_events;
587 /* Reply request if a wanted event has already occurred */
589 if(events != 0)
591 request->ios2_WireError = events;
592 complete = TRUE;
594 else
596 request->ios2_Req.io_Flags &= ~IOF_QUICK;
597 PutMsg(unit->rhineu_request_ports[EVENT_QUEUE], (APTR)request);
600 /* Return */
602 return complete;
605 static BOOL CmdReadOrphan(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
607 struct VIARHINEUnit *unit;
608 BYTE error = 0;
609 ULONG wire_error;
610 BOOL complete = FALSE;
612 /* Check request is valid */
614 unit = (APTR)request->ios2_Req.io_Unit;
615 D(bug("%s: S2CmdReadOrphan()\n", unit->rhineu_name));
617 if((unit->rhineu_flags & IFF_UP) == 0)
619 error = S2ERR_OUTOFSERVICE;
620 wire_error = S2WERR_UNIT_OFFLINE;
623 /* Queue request */
625 if(error == 0)
627 request->ios2_Req.io_Flags &= ~IOF_QUICK;
628 PutMsg(unit->rhineu_request_ports[ADOPT_QUEUE], (struct Message *)request);
630 else
632 request->ios2_Req.io_Error = error;
633 request->ios2_WireError = wire_error;
634 complete = TRUE;
637 /* Return */
639 return complete;
642 static BOOL CmdOnline(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
644 struct VIARHINEUnit *unit = (struct VIARHINEUnit *)request->ios2_Req.io_Unit;
645 BYTE error = 0;
646 ULONG wire_error = 0;
647 UWORD i;
649 D(bug("%s: S2CmdOnline()\n", unit->rhineu_name));
651 /* Check request is valid */
652 if((unit->rhineu_flags & IFF_CONFIGURED) == 0)
654 error = S2ERR_BAD_STATE;
655 wire_error = S2WERR_NOT_CONFIGURED;
658 /* Clear global and special stats and put adapter back online */
660 if((error == 0) && ((unit->rhineu_flags & IFF_UP) == 0))
662 unit->rhineu_stats.PacketsReceived = 0;
663 unit->rhineu_stats.PacketsSent = 0;
664 unit->rhineu_stats.BadData = 0;
665 unit->rhineu_stats.Overruns = 0;
666 unit->rhineu_stats.UnknownTypesReceived = 0;
667 unit->rhineu_stats.Reconfigurations = 0;
669 for(i = 0; i < STAT_COUNT; i++)
670 unit->rhineu_special_stats[i] = 0;
672 if (unit->start(unit))
674 error = S2ERR_OUTOFSERVICE;
675 wire_error = S2WERR_GENERIC_ERROR;
679 /* Return */
681 request->ios2_Req.io_Error = error;
682 request->ios2_WireError = wire_error;
683 return TRUE;
686 static BOOL CmdOffline(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
688 struct VIARHINEUnit *unit;
690 /* Put adapter offline */
692 unit = (APTR)request->ios2_Req.io_Unit;
694 D(bug("%s: S2CmdOffline()\n", unit->rhineu_name));
696 if((unit->rhineu_flags & IFF_UP) != 0)
697 unit->stop(unit);
699 /* Return */
700 return TRUE;
703 static BOOL CmdAddMulticastAddresses(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
705 struct VIARHINEUnit *unit;
706 UBYTE *lower_bound, *upper_bound;
708 unit = (APTR)request->ios2_Req.io_Unit;
710 D(bug("%s: S2CmdAddMulticastAddresses()\n", unit->rhineu_name));
712 lower_bound = request->ios2_SrcAddr;
713 if(request->ios2_Req.io_Command == S2_ADDMULTICASTADDRESS)
714 upper_bound = lower_bound;
715 else
716 upper_bound = request->ios2_DstAddr;
718 if(!AddMulticastRange(LIBBASE, unit, lower_bound, upper_bound))
720 request->ios2_Req.io_Error = S2ERR_NO_RESOURCES;
721 request->ios2_WireError = S2WERR_GENERIC_ERROR;
724 /* Return */
726 return TRUE;
729 static BOOL CmdDelMulticastAddresses(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
731 struct VIARHINEUnit *unit;
732 UBYTE *lower_bound, *upper_bound;
734 unit = (APTR)request->ios2_Req.io_Unit;
736 D(bug("%s: S2CmdDelMulticastAddresses()\n", unit->rhineu_name));
738 lower_bound = request->ios2_SrcAddr;
739 if(request->ios2_Req.io_Command == S2_DELMULTICASTADDRESS)
740 upper_bound = lower_bound;
741 else
742 upper_bound = request->ios2_DstAddr;
744 if(!RemMulticastRange(LIBBASE, unit, lower_bound, upper_bound))
746 request->ios2_Req.io_Error = S2ERR_BAD_STATE;
747 request->ios2_WireError = S2WERR_BAD_MULTICAST;
750 /* Return */
752 return TRUE;