pccardvar.h (61788) | pccardvar.h (64850) |
---|---|
1/* $NetBSD: pcmciavar.h,v 1.9 1998/12/29 09:00:28 marc Exp $ */ | 1/* $NetBSD: pcmciavar.h,v 1.9 1998/12/29 09:00:28 marc Exp $ */ |
2/* $FreeBSD: head/sys/dev/pccard/pccardvar.h 61788 2000-06-18 05:28:59Z imp $ */ | 2/* $FreeBSD: head/sys/dev/pccard/pccardvar.h 64850 2000-08-19 19:22:04Z imp $ */ |
3 4/* 5 * Copyright (c) 1997 Marc Horowitz. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 225 unchanged lines hidden (view full) --- 236#define PCCARD_SPACE_IO 2 237 238int pccard_ccr_read(struct pccard_function *, int); 239void pccard_ccr_write(struct pccard_function *, int, int); 240 241#define pccard_mfc(sc) (STAILQ_FIRST(&(sc)->card.pf_head) && \ 242 STAILQ_NEXT(STAILQ_FIRST(&(sc)->card.pf_head),pf_list)) 243 | 3 4/* 5 * Copyright (c) 1997 Marc Horowitz. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 225 unchanged lines hidden (view full) --- 236#define PCCARD_SPACE_IO 2 237 238int pccard_ccr_read(struct pccard_function *, int); 239void pccard_ccr_write(struct pccard_function *, int, int); 240 241#define pccard_mfc(sc) (STAILQ_FIRST(&(sc)->card.pf_head) && \ 242 STAILQ_NEXT(STAILQ_FIRST(&(sc)->card.pf_head),pf_list)) 243 |
244/* The following is the vestages of the NetBSD driver api */ 245 |
|
244void pccard_function_init(struct pccard_function *, 245 struct pccard_config_entry *); 246int pccard_function_enable(struct pccard_function *); 247void pccard_function_disable(struct pccard_function *); 248 249#define pccard_io_alloc(pf, start, size, align, pciop) \ 250 (pccard_chip_io_alloc((pf)->sc->pct, pf->sc->pch, (start), \ 251 (size), (align), (pciop))) 252 253#define pccard_io_free(pf, pciohp) \ 254 (pccard_chip_io_free((pf)->sc->pct, (pf)->sc->pch, (pciohp))) 255 256int pccard_io_map(struct pccard_function *, int, bus_addr_t, 257 bus_size_t, struct pccard_io_handle *, int *); 258void pccard_io_unmap(struct pccard_function *, int); 259 260#define pccard_mem_alloc(pf, size, pcmhp) \ 261 (pccard_chip_mem_alloc((pf)->sc->pct, (pf)->sc->pch, (size), (pcmhp))) | 246void pccard_function_init(struct pccard_function *, 247 struct pccard_config_entry *); 248int pccard_function_enable(struct pccard_function *); 249void pccard_function_disable(struct pccard_function *); 250 251#define pccard_io_alloc(pf, start, size, align, pciop) \ 252 (pccard_chip_io_alloc((pf)->sc->pct, pf->sc->pch, (start), \ 253 (size), (align), (pciop))) 254 255#define pccard_io_free(pf, pciohp) \ 256 (pccard_chip_io_free((pf)->sc->pct, (pf)->sc->pch, (pciohp))) 257 258int pccard_io_map(struct pccard_function *, int, bus_addr_t, 259 bus_size_t, struct pccard_io_handle *, int *); 260void pccard_io_unmap(struct pccard_function *, int); 261 262#define pccard_mem_alloc(pf, size, pcmhp) \ 263 (pccard_chip_mem_alloc((pf)->sc->pct, (pf)->sc->pch, (size), (pcmhp))) |
262 | |
263#define pccard_mem_free(pf, pcmhp) \ 264 (pccard_chip_mem_free((pf)->sc->pct, (pf)->sc->pch, (pcmhp))) | 264#define pccard_mem_free(pf, pcmhp) \ 265 (pccard_chip_mem_free((pf)->sc->pct, (pf)->sc->pch, (pcmhp))) |
265 | |
266#define pccard_mem_map(pf, kind, card_addr, size, pcmhp, offsetp, windowp) \ 267 (pccard_chip_mem_map((pf)->sc->pct, (pf)->sc->pch, (kind), \ 268 (card_addr), (size), (pcmhp), (offsetp), (windowp))) | 266#define pccard_mem_map(pf, kind, card_addr, size, pcmhp, offsetp, windowp) \ 267 (pccard_chip_mem_map((pf)->sc->pct, (pf)->sc->pch, (kind), \ 268 (card_addr), (size), (pcmhp), (offsetp), (windowp))) |
269 | |
270#define pccard_mem_unmap(pf, window) \ 271 (pccard_chip_mem_unmap((pf)->sc->pct, (pf)->sc->pch, (window))) 272 273/* ivar interface */ 274enum { 275 PCCARD_IVAR_ETHADDR, /* read ethernet address from CIS tupple */ 276}; 277 --- 4 unchanged lines hidden (view full) --- 282 return BUS_READ_IVAR(device_get_parent(dev), dev, 283 PCCARD_IVAR_ETHADDR, (uintptr_t *)enaddr); 284} 285 286enum { 287 PCCARD_A_MEM_ATTR = 0x1 288}; 289 | 269#define pccard_mem_unmap(pf, window) \ 270 (pccard_chip_mem_unmap((pf)->sc->pct, (pf)->sc->pch, (window))) 271 272/* ivar interface */ 273enum { 274 PCCARD_IVAR_ETHADDR, /* read ethernet address from CIS tupple */ 275}; 276 --- 4 unchanged lines hidden (view full) --- 281 return BUS_READ_IVAR(device_get_parent(dev), dev, 282 PCCARD_IVAR_ETHADDR, (uintptr_t *)enaddr); 283} 284 285enum { 286 PCCARD_A_MEM_ATTR = 0x1 287}; 288 |
289#define PCCARD_SOFTC(d) (struct pccard_softc *) device_get_softc(d) |
|