proto.h (b5ff185e19f6013ca565b2a15bc2d6abce933f46) | proto.h (9f011bca829751ed3552ac94fe7c865d75fabfc4) |
---|---|
1/*- | 1/*- |
2 * Copyright (c) 2014, 2015 Marcel Moolenaar | 2 * Copyright (c) 2014, 2015, 2019 Marcel Moolenaar |
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 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. --- 20 unchanged lines hidden (view full) --- 31 32#define PROTO_RES_MAX 16 33 34#define PROTO_RES_UNUSED 0 35#define PROTO_RES_PCICFG 10 36#define PROTO_RES_BUSDMA 11 37 38struct proto_res { | 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 * 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. --- 20 unchanged lines hidden (view full) --- 31 32#define PROTO_RES_MAX 16 33 34#define PROTO_RES_UNUSED 0 35#define PROTO_RES_PCICFG 10 36#define PROTO_RES_BUSDMA 11 37 38struct proto_res { |
39 int r_type; | 39 u_int r_type:8; 40 u_int r_opened:1; |
40 int r_rid; 41 union { 42 struct resource *res; 43 void *busdma; 44 } r_d; 45 u_long r_size; 46 union { 47 void *cookie; 48 struct cdev *cdev; 49 } r_u; | 41 int r_rid; 42 union { 43 struct resource *res; 44 void *busdma; 45 } r_d; 46 u_long r_size; 47 union { 48 void *cookie; 49 struct cdev *cdev; 50 } r_u; |
50 uintptr_t r_opened; | |
51}; 52 53struct proto_softc { 54 device_t sc_dev; 55 struct proto_res sc_res[PROTO_RES_MAX]; 56 int sc_rescnt; | 51}; 52 53struct proto_softc { 54 device_t sc_dev; 55 struct proto_res sc_res[PROTO_RES_MAX]; 56 int sc_rescnt; |
57 int sc_opencnt; 58 struct mtx sc_mtx; |
|
57}; 58 59extern devclass_t proto_devclass; 60extern char proto_driver_name[]; 61 62int proto_add_resource(struct proto_softc *, int, int, struct resource *); 63 64int proto_probe(device_t dev, const char *prefix, char ***devnamesp); 65int proto_attach(device_t dev); 66int proto_detach(device_t dev); 67 68#endif /* _DEV_PROTO_H_ */ | 59}; 60 61extern devclass_t proto_devclass; 62extern char proto_driver_name[]; 63 64int proto_add_resource(struct proto_softc *, int, int, struct resource *); 65 66int proto_probe(device_t dev, const char *prefix, char ***devnamesp); 67int proto_attach(device_t dev); 68int proto_detach(device_t dev); 69 70#endif /* _DEV_PROTO_H_ */ |