Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / networks / etherlink3 / pccard.c
blob0d928f35255d1a4961b661ce76e16097dea725bb
1 /*
3 Copyright (C) 2000-2011 Neil Cafferkey
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 MA 02111-1307, USA.
23 #include <exec/types.h>
24 #include <utility/tagitem.h>
25 #include <libraries/pccard.h>
26 #include <resources/card.h>
28 #include <proto/exec.h>
29 #include <proto/utility.h>
30 #include <proto/cardres.h>
31 #include <proto/pccard.h>
33 #include "device.h"
35 #include "pccard_protos.h"
36 #include "device_protos.h"
37 #include "unit_protos.h"
39 #define MAX_TUPLE_SIZE 0xff
40 #define TUPLE_BUFFER_SIZE (MAX_TUPLE_SIZE + 8)
41 #define HANDLE_PRIORITY 10
42 #define IO_WINDOW_SIZE 0x10
45 struct BusContext
47 struct DevUnit *unit;
48 struct CardHandle *card_handle;
49 UBYTE *tuple_buffer;
50 UPINT config_base;
51 UPINT io_base;
52 UWORD resource_version;
53 BOOL have_card;
57 /* Private prototypes */
59 static struct DevUnit *FindPCCardUnit(ULONG index, struct DevBase *base);
60 static struct DevUnit *CreatePCCardUnit(ULONG index,
61 struct DevBase *base);
62 static struct BusContext *AllocCard(struct DevBase *base);
63 static VOID FreeCard(struct BusContext *context, struct DevBase *base);
64 static BOOL IsCardCompatible(struct BusContext *context,
65 struct DevBase *base);
66 static BOOL InitialiseCard(struct BusContext *context,
67 struct DevBase *base);
68 static VOID CardRemovedHook(struct BusContext *context,
69 struct DevBase *base);
70 static BOOL CardInsertedHook(struct BusContext *context,
71 struct DevBase *base);
72 static VOID CardRemovedInt(REG(a1, struct BusContext *context),
73 REG(a6, APTR int_code));
74 static VOID CardInsertedInt(REG(a1, struct BusContext *context),
75 REG(a6, APTR int_code));
76 static UBYTE CardStatusInt(REG(a1, struct BusContext *context),
77 REG(a6, APTR int_code), REG(d0, UBYTE mask));
78 static UBYTE ByteInHook(struct BusContext *context, ULONG offset);
79 static ULONG LongInHook(struct BusContext *context, ULONG offset);
80 static VOID ByteOutHook(struct BusContext *context, ULONG offset,
81 UBYTE value);
82 static VOID WordOutHook(struct BusContext *context, ULONG offset,
83 UWORD value);
84 static VOID LongOutHook(struct BusContext *context, ULONG offset,
85 ULONG value);
86 static VOID LongsInHook(struct BusContext *context, ULONG offset,
87 ULONG *buffer, ULONG count);
88 static VOID LongsOutHook(struct BusContext *context, ULONG offset,
89 const ULONG *buffer, ULONG count);
90 static VOID BEWordOutHook(struct BusContext *context, ULONG offset,
91 UWORD value);
92 static UWORD LEWordInHook(struct BusContext *context, ULONG offset);
93 static ULONG LELongInHook(struct BusContext *context, ULONG offset);
94 static VOID LEWordOutHook(struct BusContext *context, ULONG offset,
95 UWORD value);
96 static VOID LELongOutHook(struct BusContext *context, ULONG offset,
97 ULONG value);
100 static const ULONG product_codes[] =
102 0x01010035,
103 0x0101003d,
104 0x01010562,
105 0x01010589,
110 static struct TagItem unit_tags[] =
112 {IOTAG_ByteIn, (UPINT)ByteInHook},
113 {IOTAG_LongIn, (UPINT)LongInHook},
114 {IOTAG_ByteOut, (UPINT)ByteOutHook},
115 {IOTAG_WordOut, (UPINT)WordOutHook},
116 {IOTAG_LongOut, (UPINT)LongOutHook},
117 {IOTAG_LongsIn, (UPINT)LongsInHook},
118 {IOTAG_LongsOut, (UPINT)LongsOutHook},
119 {IOTAG_BEWordOut, (UPINT)BEWordOutHook},
120 {IOTAG_LEWordIn, (UPINT)LEWordInHook},
121 {IOTAG_LELongIn, (UPINT)LELongInHook},
122 {IOTAG_LEWordOut, (UPINT)LEWordOutHook},
123 {IOTAG_LELongOut, (UPINT)LELongOutHook},
124 {TAG_END, 0}
128 /****i* etherlink3.device/GetPCCardCount ***********************************
130 * NAME
131 * GetPCCardCount -- Get the number of compatible PC Cards.
133 * SYNOPSIS
134 * count = GetPCCardCount()
136 * ULONG GetPCCardCount();
138 ****************************************************************************
142 ULONG GetPCCardCount(struct DevBase *base)
144 ULONG count = 0;
145 struct BusContext *context;
147 if(CardResource != NULL)
149 if(FindPCCardUnit(0, base) != NULL)
150 count = 1;
151 else
153 context = AllocCard(base);
154 if(context != NULL)
156 count = 1;
157 FreeCard(context, base);
162 return count;
167 /****i* etherlink3.device/GetPCCardUnit ************************************
169 * NAME
170 * GetPCCardUnit -- Get a unit by number.
172 * SYNOPSIS
173 * unit = GetPCCardUnit(index)
175 * struct DevUnit *GetPCCardUnit(ULONG);
177 ****************************************************************************
181 struct DevUnit *GetPCCardUnit(ULONG index, struct DevBase *base)
183 struct DevUnit *unit;
185 unit = FindPCCardUnit(index, base);
187 if(unit == NULL)
189 unit = CreatePCCardUnit(index, base);
190 if(unit != NULL)
191 AddTail((APTR)&base->pccard_units, (APTR)unit);
194 return unit;
199 /****i* etherlink3.device/FindPCCardUnit ***********************************
201 * NAME
202 * FindPCCardUnit -- Find a unit by number.
204 * SYNOPSIS
205 * unit = FindPCCardUnit(index)
207 * struct DevUnit *FindPCCardUnit(ULONG);
209 ****************************************************************************
213 static struct DevUnit *FindPCCardUnit(ULONG index, struct DevBase *base)
215 struct DevUnit *unit, *tail;
217 unit = (APTR)base->pccard_units.mlh_Head;
218 tail = (APTR)&base->pccard_units.mlh_Tail;
219 if(unit == tail)
220 unit = NULL;
222 return unit;
227 /****i* etherlink3.device/CreatePCCardUnit *********************************
229 * NAME
230 * CreatePCCardUnit -- Create a unit.
232 * SYNOPSIS
233 * unit = CreatePCCardUnit(index)
235 * struct DevUnit *CreatePCCardUnit(ULONG);
237 * FUNCTION
238 * Creates a new unit.
240 ****************************************************************************
244 static struct DevUnit *CreatePCCardUnit(ULONG index,
245 struct DevBase *base)
247 BOOL success = TRUE;
248 struct BusContext *context;
249 struct DevUnit *unit;
251 /* Get card from system */
253 context = AllocCard(base);
254 if(context == NULL)
255 success = FALSE;
257 /* Prepare card for use */
259 if(success)
261 if(!InitialiseCard(context, base))
262 success = FALSE;
265 /* Create device driver unit */
267 if(success)
269 context->unit = unit =
270 CreateUnit(index, context, unit_tags, SECOND_GEN,
271 PCCARD_BUS, base);
272 if(unit == NULL)
273 success = FALSE;
276 if(success)
278 if(!(WrapInt(&unit->status_int, base)
279 && WrapInt(&unit->rx_int, base)
280 && WrapInt(&unit->tx_int, base)
281 && WrapInt(&unit->tx_end_int, base)))
282 success = FALSE;
284 unit->insertion_function = (APTR)CardInsertedHook;
285 unit->removal_function = (APTR)CardRemovedHook;
288 if(!success)
290 if(context != NULL)
292 DeleteUnit(context->unit, base);
293 FreeCard(context, base);
295 unit = NULL;
298 return unit;
303 /****i* etherlink3.device/DeletePCCardUnit *********************************
305 * NAME
306 * DeletePCCardUnit -- Delete a unit.
308 * SYNOPSIS
309 * DeletePCCardUnit(unit)
311 * VOID DeletePCCardUnit(struct DevUnit *);
313 * FUNCTION
314 * Deletes a unit.
316 * INPUTS
317 * unit - Device unit (may be NULL).
319 * RESULT
320 * None.
322 ****************************************************************************
326 VOID DeletePCCardUnit(struct DevUnit *unit, struct DevBase *base)
328 struct BusContext *context;
330 if(unit != NULL)
332 UnwrapInt(&unit->tx_end_int, base);
333 UnwrapInt(&unit->tx_int, base);
334 UnwrapInt(&unit->rx_int, base);
335 UnwrapInt(&unit->status_int, base);
336 context = unit->card;
337 DeleteUnit(unit, base);
338 context->unit = NULL;
339 FreeCard(context, base);
342 return;
347 /****i* etherlink3.device/AllocCard ****************************************
349 * NAME
350 * AllocCard -- Get card from system.
352 * SYNOPSIS
353 * context = AllocCard()
355 * struct BusContext *AllocCard();
357 ****************************************************************************
361 static struct BusContext *AllocCard(struct DevBase *base)
363 BOOL success = TRUE;
364 struct BusContext *context;
365 struct CardHandle *card_handle;
366 struct Interrupt *card_removed_int, *card_inserted_int, *card_status_int;
368 context = AllocMem(sizeof(struct BusContext), MEMF_PUBLIC | MEMF_CLEAR);
369 if(context == NULL)
370 success = FALSE;
372 if(success)
374 context->resource_version =
375 ((struct Library *)base->card_base)->lib_Version;
376 context->card_handle = card_handle =
377 AllocMem(sizeof(struct CardHandle), MEMF_PUBLIC | MEMF_CLEAR);
378 context->tuple_buffer =
379 AllocVec(TUPLE_BUFFER_SIZE, MEMF_PUBLIC);
381 if(card_handle == NULL || context->tuple_buffer == NULL)
382 success = FALSE;
385 if(success)
387 /* Set up card handle */
389 card_handle->cah_CardNode.ln_Pri = HANDLE_PRIORITY;
390 card_handle->cah_CardNode.ln_Name =
391 base->device.dd_Library.lib_Node.ln_Name;
392 card_handle->cah_CardFlags = CARDF_POSTSTATUS;
394 card_handle->cah_CardRemoved = card_removed_int =
395 AllocVec(sizeof(struct Interrupt), MEMF_PUBLIC | MEMF_CLEAR);
397 card_handle->cah_CardInserted = card_inserted_int =
398 AllocVec(sizeof(struct Interrupt), MEMF_PUBLIC | MEMF_CLEAR);
400 card_handle->cah_CardStatus = card_status_int =
401 AllocVec(sizeof(struct Interrupt), MEMF_PUBLIC | MEMF_CLEAR);
403 if(card_removed_int == NULL || card_inserted_int == NULL
404 || card_status_int == NULL)
405 success = FALSE;
408 if(success)
410 /* Try to gain access to card */
412 card_removed_int->is_Code = CardRemovedInt;
413 card_removed_int->is_Data = context;
414 card_inserted_int->is_Code = CardInsertedInt;
415 card_inserted_int->is_Data = context;
416 card_status_int->is_Code = (APTR)CardStatusInt;
417 card_status_int->is_Data = context;
419 if(!(WrapCardInt(card_removed_int, base)
420 && WrapCardInt(card_inserted_int, base)
421 && WrapCardInt(card_status_int, base)))
422 success = FALSE;
425 if(success)
427 if(OwnCard(card_handle) != 0)
428 success = FALSE;
431 if(success)
433 context->have_card = TRUE;
434 if(!IsCardCompatible(context, base))
435 success = FALSE;
438 if(!success)
440 FreeCard(context, base);
441 context = NULL;
443 return context;
448 /****i* etherlink3.device/FreeCard *****************************************
450 * NAME
451 * FreeCard -- Release a card.
453 * SYNOPSIS
454 * FreeCard(context)
456 * VOID FreeCard(struct BusContext *);
458 ****************************************************************************
462 static VOID FreeCard(struct BusContext *context, struct DevBase *base)
464 struct CardHandle *card_handle;
466 if(context != NULL)
468 card_handle = context->card_handle;
470 if(context->have_card)
472 CardMiscControl(card_handle, 0);
473 CardResetCard(card_handle);
475 ReleaseCard(card_handle, CARDF_REMOVEHANDLE);
476 UnwrapCardInt(card_handle->cah_CardStatus, base);
477 UnwrapCardInt(card_handle->cah_CardInserted, base);
478 UnwrapCardInt(card_handle->cah_CardRemoved, base);
480 FreeVec(card_handle->cah_CardStatus);
481 FreeVec(card_handle->cah_CardInserted);
482 FreeVec(card_handle->cah_CardRemoved);
483 FreeVec(context->tuple_buffer);
484 FreeMem(card_handle, sizeof(struct CardHandle));
486 FreeMem(context, sizeof(struct BusContext));
489 return;
494 /****i* etherlink3.device/IsCardCompatible *********************************
496 * NAME
497 * IsCardCompatible
499 * SYNOPSIS
500 * compatible = IsCardCompatible(context)
502 * BOOL IsCardCompatible(struct BusContext *);
504 ****************************************************************************
508 static BOOL IsCardCompatible(struct BusContext *context,
509 struct DevBase *base)
511 BOOL success = TRUE;
512 struct CardHandle *card_handle;
513 UBYTE *tuple_buffer;
514 struct TagItem *tuple_tags = NULL;
515 ULONG code;
516 const ULONG *p;
517 UWORD maker = 0, product = 0;
519 card_handle = context->card_handle;
520 tuple_buffer = context->tuple_buffer;
522 /* Get card's make and model */
524 if(CopyTuple(card_handle, tuple_buffer, PCCARD_TPL_MANFID,
525 MAX_TUPLE_SIZE))
527 tuple_tags = PCCard_GetTupleInfo(tuple_buffer);
528 if(tuple_tags != NULL)
530 maker = GetTagData(PCCARD_Maker, 0, tuple_tags);
531 product = GetTagData(PCCARD_Product, 0, tuple_tags);
535 /* Check this is a card we can use */
537 code = maker << 16 | product;
538 for(success = FALSE, p = product_codes; *p != 0; p++)
539 if(*p == code)
540 success = TRUE;
541 PCCard_FreeTupleInfo(tuple_tags);
543 return success;
548 /****i* etherlink3.device/InitialiseCard ***********************************
550 * NAME
551 * InitialiseCard
553 * SYNOPSIS
554 * success = InitialiseCard(context)
556 * BOOL InitialiseCard(struct BusContext *);
558 ****************************************************************************
562 static BOOL InitialiseCard(struct BusContext *context,
563 struct DevBase *base)
565 BOOL success = TRUE;
566 struct CardHandle *card_handle;
567 struct CardMemoryMap *card_map;
568 UBYTE config_value, i, window_count, *tuple_buffer;
569 struct TagItem *tuple_tags = NULL;
570 ULONG *io_bases, *io_lengths, io_base_offset = 0, config_base_offset;
572 /* Wake up card's I/O functionality */
574 card_handle = context->card_handle;
575 tuple_buffer = context->tuple_buffer;
576 CardMiscControl(card_handle,
577 CARD_ENABLEF_DIGAUDIO | CARD_DISABLEF_WP);
579 /* Get configuration data */
581 if(!CopyTuple(card_handle, tuple_buffer, PCCARD_TPL_CONFIG,
582 MAX_TUPLE_SIZE))
583 success = FALSE;
585 if(success)
587 PCCard_FreeTupleInfo(tuple_tags);
588 tuple_tags = PCCard_GetTupleInfo(tuple_buffer);
589 if(tuple_tags == NULL)
590 success = FALSE;
593 if(success)
595 config_base_offset = GetTagData(PCCARD_RegisterBase, 0, tuple_tags);
597 PCCard_FreeTupleInfo(tuple_tags);
598 tuple_tags = NULL;
600 /* Get IO base */
602 if(!CopyTuple(card_handle, tuple_buffer, PCCARD_TPL_CFTABLEENTRY,
603 MAX_TUPLE_SIZE))
604 success = FALSE;
607 if(success)
609 tuple_tags = PCCard_GetTupleInfo(tuple_buffer);
610 if(tuple_tags == NULL)
611 success = FALSE;
614 if(success)
616 config_value = GetTagData(PCCARD_ModeNo, 0, tuple_tags);
618 io_bases =
619 (APTR)GetTagData(PCCARD_IOWinBases, (UPINT)NULL, tuple_tags);
620 if(io_bases == NULL)
621 success = FALSE;
624 /* Find the appropriate IO window */
626 if(success)
628 io_lengths =
629 (APTR)GetTagData(PCCARD_IOWinLengths, (UPINT)NULL, tuple_tags);
631 window_count = GetTagData(PCCARD_IOWinCount, 0, tuple_tags);
633 for(i = 0; i < window_count && io_base_offset == 0; i++)
634 if(io_lengths[i] == IO_WINDOW_SIZE)
635 io_base_offset = io_bases[i];
638 PCCard_FreeTupleInfo(tuple_tags);
640 /* Configure card */
642 if(success)
644 card_map = GetCardMap();
645 context->config_base =
646 (UPINT)card_map->cmm_AttributeMemory + config_base_offset;
648 context->io_base = (UPINT)card_map->cmm_IOMemory + io_base_offset;
649 BYTEOUT(context->config_base + PCCARD_REG_COR, config_value);
650 BYTEOUT(context->config_base + PCCARD_REG_CCSR,
651 BYTEIN(context->config_base + PCCARD_REG_CCSR)
652 | PCCARD_REG_CCSRF_AUDIOENABLE);
655 return success;
660 /****i* etherlink3.device/CardRemovedHook **********************************
662 * NAME
663 * CardRemovedHook
665 * SYNOPSIS
666 * CardRemovedHook(context)
668 * VOID CardRemovedHook(struct BusContext *);
670 ****************************************************************************
674 static VOID CardRemovedHook(struct BusContext *context,
675 struct DevBase *base)
677 ReleaseCard(context->card_handle, 0);
679 return;
684 /****i* etherlink3.device/CardInsertedHook *********************************
686 * NAME
687 * CardInsertedHook
689 * SYNOPSIS
690 * success = CardInsertedHook(context)
692 * BOOL CardInsertedHook(struct BusContext *);
694 ****************************************************************************
698 static BOOL CardInsertedHook(struct BusContext *context,
699 struct DevBase *base)
701 BOOL success = TRUE;
703 success = IsCardCompatible(context, base);
705 if(success)
706 success = InitialiseCard(context, base);
708 if(success)
709 success = InitialiseAdapter(context->unit, TRUE, base);
711 if(!success)
712 ReleaseCard(context->card_handle, 0);
714 return success;
719 /****i* etherlink3.device/CardRemovedInt ***********************************
721 * NAME
722 * CardRemovedInt
724 * SYNOPSIS
725 * CardRemovedInt(context, int_code)
727 * VOID CardRemovedInt(struct BusContext *, APTR);
729 ****************************************************************************
733 static VOID CardRemovedInt(REG(a1, struct BusContext *context),
734 REG(a6, APTR int_code))
736 struct DevBase *base;
737 struct DevUnit *unit;
739 /* Record loss of card and get our task to call ReleaseCard() */
741 unit = context->unit;
742 if(unit != NULL)
744 base = unit->device;
745 if((unit->flags & UNITF_ONLINE) != 0)
746 unit->flags |= UNITF_WASONLINE;
747 unit->flags &= ~(UNITF_HAVEADAPTER | UNITF_ONLINE);
749 context->have_card = FALSE;
750 if(unit != NULL)
751 Signal(unit->task, unit->card_removed_signal);
753 return;
758 /****i* etherlink3.device/CardInsertedInt **********************************
760 * NAME
761 * CardInsertedInt
763 * SYNOPSIS
764 * CardInsertedInt(context, int_code)
766 * VOID CardInsertedInt(struct BusContext *, APTR);
768 ****************************************************************************
772 static VOID CardInsertedInt(REG(a1, struct BusContext *context),
773 REG(a6, APTR int_code))
775 struct DevBase *base;
776 struct DevUnit *unit;
778 unit = context->unit;
779 if (unit != NULL) {
780 base = unit->device;
781 context->have_card = TRUE;
782 Signal(unit->task, unit->card_inserted_signal);
785 return;
790 /****i* etherlink3.device/CardStatusInt ************************************
792 * NAME
793 * CardStatusInt
795 * SYNOPSIS
796 * mask = CardStatusInt(context, int_code, mask)
798 * UBYTE CardStatusInt(struct BusContext *, APTR, UBYTE);
800 ****************************************************************************
802 * We pretend the int_code parameter goes in A6 rather than A5 because 68k
803 * GCC can't cope with A5 and we know the parameter isn't used in this case.
807 static UBYTE CardStatusInt(REG(a1, struct BusContext *context),
808 REG(a6, APTR int_code), REG(d0, UBYTE mask))
810 if(context->resource_version < 39)
812 /* Work around gayle interrupt bug */
814 *((volatile UBYTE *)0xda9000) = (mask ^ 0x2c) | 0xc0;
815 mask = 0;
818 if(context->unit != NULL)
819 StatusInt(context->unit, StatusInt);
821 return mask;
826 /****i* etherlink3.device/ByteInHook ***************************************
828 * NAME
829 * ByteInHook
831 * SYNOPSIS
832 * value = ByteInHook(context, offset)
834 * UBYTE ByteInHook(struct BusContext *, ULONG);
836 ****************************************************************************
840 static UBYTE ByteInHook(struct BusContext *context, ULONG offset)
842 return BYTEIN(context->io_base + offset);
847 /****i* etherlink3.device/LongInHook ***************************************
849 * NAME
850 * LongInHook
852 * SYNOPSIS
853 * value = LongInHook(context, offset)
855 * ULONG LongInHook(struct BusContext *, ULONG);
857 ****************************************************************************
861 static ULONG LongInHook(struct BusContext *context, ULONG offset)
863 return LONGIN(context->io_base + offset);
868 /****i* etherlink3.device/ByteOutHook **************************************
870 * NAME
871 * ByteOutHook
873 * SYNOPSIS
874 * ByteOutHook(context, offset, value)
876 * VOID ByteOutHook(struct BusContext *, ULONG, UBYTE);
878 ****************************************************************************
882 static VOID ByteOutHook(struct BusContext *context, ULONG offset,
883 UBYTE value)
885 BYTEOUT(context->io_base + offset, value);
887 return;
892 /****i* etherlink3.device/WordOutHook **************************************
894 * NAME
895 * WordOutHook
897 * SYNOPSIS
898 * WordOutHook(context, offset, value)
900 * VOID WordOutHook(struct BusContext *, ULONG, UWORD);
902 ****************************************************************************
906 static VOID WordOutHook(struct BusContext *context, ULONG offset,
907 UWORD value)
909 WORDOUT(context->io_base + offset, value);
911 return;
916 /****i* etherlink3.device/LongOutHook **************************************
918 * NAME
919 * LongOutHook
921 * SYNOPSIS
922 * LongOutHook(context, offset, value)
924 * VOID LongOutHook(struct BusContext *, ULONG, ULONG);
926 ****************************************************************************
930 static VOID LongOutHook(struct BusContext *context, ULONG offset,
931 ULONG value)
933 LONGOUT(context->io_base + offset, value);
935 return;
940 /****i* etherlink3.device/LongsInHook **************************************
942 * NAME
943 * LongsInHook
945 * SYNOPSIS
946 * LongsInHook(context, offset, buffer, count)
948 * VOID LongsInHook(struct BusContext *, ULONG, ULONG *, ULONG);
950 ****************************************************************************
954 static VOID LongsInHook(struct BusContext *context, ULONG offset,
955 ULONG *buffer, ULONG count)
957 LONGSIN(context->io_base + offset, buffer, count);
959 return;
964 /****i* etherlink3.device/LongsOutHook *************************************
966 * NAME
967 * LongsOutHook
969 * SYNOPSIS
970 * LongsOutHook(context, offset, buffer, count)
972 * VOID LongsOutHook(struct BusContext *, ULONG, const ULONG *, ULONG);
974 ****************************************************************************
978 static VOID LongsOutHook(struct BusContext *context, ULONG offset,
979 const ULONG *buffer, ULONG count)
981 LONGSOUT(context->io_base + offset, buffer, count);
983 return;
988 /****i* etherlink3.device/BEWordOutHook ************************************
990 * NAME
991 * BEWordOutHook
993 * SYNOPSIS
994 * BEWordOutHook(context, offset, value)
996 * VOID BEWordOutHook(struct BusContext *, ULONG, UWORD);
998 ****************************************************************************
1002 static VOID BEWordOutHook(struct BusContext *context, ULONG offset,
1003 UWORD value)
1005 BEWORDOUT(context->io_base + offset, value);
1007 return;
1012 /****i* etherlink3.device/LEWordInHook *************************************
1014 * NAME
1015 * LEWordInHook
1017 * SYNOPSIS
1018 * value = LEWordInHook(context, offset)
1020 * UWORD LEWordInHook(struct BusContext *, ULONG);
1022 ****************************************************************************
1026 static UWORD LEWordInHook(struct BusContext *context, ULONG offset)
1028 return LEWORDIN(context->io_base + offset);
1033 /****i* etherlink3.device/LELongInHook ***************************************
1035 * NAME
1036 * LELongInHook
1038 * SYNOPSIS
1039 * value = LELongInHook(context, offset)
1041 * ULONG LELongInHook(struct BusContext *, ULONG);
1043 ****************************************************************************
1047 static ULONG LELongInHook(struct BusContext *context, ULONG offset)
1049 return LELONGIN(context->io_base + offset);
1054 /****i* etherlink3.device/LEWordOutHook ************************************
1056 * NAME
1057 * LEWordOutHook
1059 * SYNOPSIS
1060 * LEWordOutHook(context, offset, value)
1062 * VOID LEWordOutHook(struct BusContext *, ULONG, UWORD);
1064 ****************************************************************************
1068 static VOID LEWordOutHook(struct BusContext *context, ULONG offset,
1069 UWORD value)
1071 LEWORDOUT(context->io_base + offset, value);
1073 return;
1078 /****i* etherlink3.device/LELongOutHook ************************************
1080 * NAME
1081 * LELongOutHook
1083 * SYNOPSIS
1084 * LELongOutHook(context, offset, value)
1086 * VOID LELongOutHook(struct BusContext *, ULONG, ULONG);
1088 ****************************************************************************
1092 static VOID LELongOutHook(struct BusContext *context, ULONG offset,
1093 ULONG value)
1095 LELONGOUT(context->io_base + offset, value);
1097 return;