aha_mca.c (119418) | aha_mca.c (122340) |
---|---|
1/*- 2 * Copyright (c) 1999 Matthew N. Dodd <winter@jurai.net> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * Based on aha_isa.c 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1999 Matthew N. Dodd <winter@jurai.net> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * Based on aha_isa.c 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/aha/aha_mca.c 119418 2003-08-24 17:55:58Z obrien $"); | 30__FBSDID("$FreeBSD: head/sys/dev/aha/aha_mca.c 122340 2003-11-09 00:51:52Z imp $"); |
31 32#include <sys/types.h> 33#include <sys/param.h> 34#include <sys/kernel.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> 37 38#include <sys/module.h> --- 14 unchanged lines hidden (view full) --- 53 { 0, NULL }, 54}; 55 56#define AHA_MCA_IOPORT_POS MCA_ADP_POS(MCA_POS1) 57# define AHA_MCA_IOPORT_MASK1 0x07 58# define AHA_MCA_IOPORT_MASK2 0xc0 59# define AHA_MCA_IOPORT_SIZE 0x03 60# define AHA_MCA_IOPORT(pos) (0x30 + \ | 31 32#include <sys/types.h> 33#include <sys/param.h> 34#include <sys/kernel.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> 37 38#include <sys/module.h> --- 14 unchanged lines hidden (view full) --- 53 { 0, NULL }, 54}; 55 56#define AHA_MCA_IOPORT_POS MCA_ADP_POS(MCA_POS1) 57# define AHA_MCA_IOPORT_MASK1 0x07 58# define AHA_MCA_IOPORT_MASK2 0xc0 59# define AHA_MCA_IOPORT_SIZE 0x03 60# define AHA_MCA_IOPORT(pos) (0x30 + \ |
61 (((u_int32_t)pos & \ | 61 (((uint32_t)pos & \ |
62 AHA_MCA_IOPORT_MASK1) << 8) + \ | 62 AHA_MCA_IOPORT_MASK1) << 8) + \ |
63 (((u_int32_t)pos & \ | 63 (((uint32_t)pos & \ |
64 AHA_MCA_IOPORT_MASK2) >> 4)) 65 66#define AHA_MCA_DRQ_POS MCA_ADP_POS(MCA_POS3) 67# define AHA_MCA_DRQ_MASK 0x0f 68# define AHA_MCA_DRQ(pos) (pos & AHA_MCA_DRQ_MASK) 69 70#define AHA_MCA_IRQ_POS MCA_ADP_POS(MCA_POS2) 71# define AHA_MCA_IRQ_MASK 0x07 --- 8 unchanged lines hidden (view full) --- 80#define AHA_MCA_SCSIID_MASK 0xe0 81#define AHA_MCA_SCSIID(pos) ((pos & AHA_MCA_SCSIID_MASK) >> 5) 82 83static int 84aha_mca_probe (device_t dev) 85{ 86 const char * desc; 87 mca_id_t id = mca_get_id(dev); | 64 AHA_MCA_IOPORT_MASK2) >> 4)) 65 66#define AHA_MCA_DRQ_POS MCA_ADP_POS(MCA_POS3) 67# define AHA_MCA_DRQ_MASK 0x0f 68# define AHA_MCA_DRQ(pos) (pos & AHA_MCA_DRQ_MASK) 69 70#define AHA_MCA_IRQ_POS MCA_ADP_POS(MCA_POS2) 71# define AHA_MCA_IRQ_MASK 0x07 --- 8 unchanged lines hidden (view full) --- 80#define AHA_MCA_SCSIID_MASK 0xe0 81#define AHA_MCA_SCSIID(pos) ((pos & AHA_MCA_SCSIID_MASK) >> 5) 82 83static int 84aha_mca_probe (device_t dev) 85{ 86 const char * desc; 87 mca_id_t id = mca_get_id(dev); |
88 u_int32_t iobase = 0; 89 u_int32_t iosize = 0; 90 u_int8_t drq = 0; 91 u_int8_t irq = 0; 92 u_int8_t pos; | 88 uint32_t iobase = 0; 89 uint32_t iosize = 0; 90 uint8_t drq = 0; 91 uint8_t irq = 0; 92 uint8_t pos; |
93 94 desc = mca_match_id(id, aha_mca_devs); 95 if (!desc) 96 return (ENXIO); 97 device_set_desc(dev, desc); 98 99 pos = mca_pos_read(dev, AHA_MCA_IOPORT_POS); 100 iobase = AHA_MCA_IOPORT(pos); --- 149 unchanged lines hidden --- | 93 94 desc = mca_match_id(id, aha_mca_devs); 95 if (!desc) 96 return (ENXIO); 97 device_set_desc(dev, desc); 98 99 pos = mca_pos_read(dev, AHA_MCA_IOPORT_POS); 100 iobase = AHA_MCA_IOPORT(pos); --- 149 unchanged lines hidden --- |