| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: cardbus.9,v 1.13 2010/02/24 23:49:34 dyoung Exp $ | | 1 | .\" $NetBSD: cardbus.9,v 1.14 2010/02/25 00:50:52 dyoung Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2001 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2001 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | | 6 | .\" This code is derived from software contributed to The NetBSD Foundation |
7 | .\" by Gregory McGarry. | | 7 | .\" by Gregory McGarry. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| @@ -30,39 +30,37 @@ | | | @@ -30,39 +30,37 @@ |
30 | .Dd February 24, 2010 | | 30 | .Dd February 24, 2010 |
31 | .Dt CARDBUS 9 | | 31 | .Dt CARDBUS 9 |
32 | .Os | | 32 | .Os |
33 | .Sh NAME | | 33 | .Sh NAME |
34 | .Nm Cardbus , | | 34 | .Nm Cardbus , |
35 | .Nm cardbus_attach_card , | | 35 | .Nm cardbus_attach_card , |
36 | .Nm cardbus_detach_card , | | 36 | .Nm cardbus_detach_card , |
37 | .Nm cardbus_function_enable , | | 37 | .Nm cardbus_function_enable , |
38 | .Nm cardbus_function_disable , | | 38 | .Nm cardbus_function_disable , |
39 | .Nm cardbus_mapreg_map , | | 39 | .Nm cardbus_mapreg_map , |
40 | .Nm cardbus_mapreg_unmap , | | 40 | .Nm cardbus_mapreg_unmap , |
41 | .Nm cardbus_get_capability , | | 41 | .Nm cardbus_get_capability , |
42 | .Nm cardbus_make_tag , | | 42 | .Nm cardbus_make_tag , |
43 | .Nm cardbus_free_tag , | | | |
44 | .Nm cardbus_conf_read , | | 43 | .Nm cardbus_conf_read , |
45 | .Nm cardbus_conf_write , | | 44 | .Nm cardbus_conf_write , |
46 | .Nm cardbus_intr_establish , | | 45 | .Nm cardbus_intr_establish , |
47 | .Nm cardbus_intr_disestablish , | | 46 | .Nm cardbus_intr_disestablish , |
48 | .Nm CARDBUS_VENDOR , | | 47 | .Nm CARDBUS_VENDOR , |
49 | .Nm CARDBUS_PRODUCT , | | 48 | .Nm CARDBUS_PRODUCT , |
50 | .Nm Cardbus_function_enable , | | 49 | .Nm Cardbus_function_enable , |
51 | .Nm Cardbus_function_disable , | | 50 | .Nm Cardbus_function_disable , |
52 | .Nm Cardbus_mapreg_map , | | 51 | .Nm Cardbus_mapreg_map , |
53 | .Nm Cardbus_mapreg_unmap , | | 52 | .Nm Cardbus_mapreg_unmap , |
54 | .Nm Cardbus_make_tag , | | 53 | .Nm Cardbus_make_tag , |
55 | .Nm Cardbus_free_tag , | | | |
56 | .Nm Cardbus_conf_read , | | 54 | .Nm Cardbus_conf_read , |
57 | .Nm Cardbus_conf_write | | 55 | .Nm Cardbus_conf_write |
58 | .Nd support for CardBus PC-Card devices | | 56 | .Nd support for CardBus PC-Card devices |
59 | .Sh SYNOPSIS | | 57 | .Sh SYNOPSIS |
60 | .In machine/bus.h | | 58 | .In machine/bus.h |
61 | .In dev/cardbus/cardbusvar.h | | 59 | .In dev/cardbus/cardbusvar.h |
62 | .In dev/cardbus/cardbusreg.h | | 60 | .In dev/cardbus/cardbusreg.h |
63 | .In dev/cardbus/cardbusdevs.h | | 61 | .In dev/cardbus/cardbusdevs.h |
64 | .Ft int | | 62 | .Ft int |
65 | .Fn cardbus_attach_card "struct cardbus_softc *csc" | | 63 | .Fn cardbus_attach_card "struct cardbus_softc *csc" |
66 | .Ft void | | 64 | .Ft void |
67 | .Fn cardbus_detach_card "struct cardbus_softc *csc" | | 65 | .Fn cardbus_detach_card "struct cardbus_softc *csc" |
68 | .Ft int | | 66 | .Ft int |
| @@ -76,29 +74,26 @@ | | | @@ -76,29 +74,26 @@ |
76 | .Fa "bus_space_handle_t *handlep" "bus_addr_t *basep" "bus_size_t *sizep" | | 74 | .Fa "bus_space_handle_t *handlep" "bus_addr_t *basep" "bus_size_t *sizep" |
77 | .Fc | | 75 | .Fc |
78 | .Ft int | | 76 | .Ft int |
79 | .Fn cardbus_mapreg_unmap "struct cardbus_softc *csc" "int cf" \ | | 77 | .Fn cardbus_mapreg_unmap "struct cardbus_softc *csc" "int cf" \ |
80 | "int reg" "bus_space_tag_t tag" "bus_space_handle_t handle" \ | | 78 | "int reg" "bus_space_tag_t tag" "bus_space_handle_t handle" \ |
81 | "bus_size_t size" | | 79 | "bus_size_t size" |
82 | .Ft int | | 80 | .Ft int |
83 | .Fn cardbus_get_capability "cardbus_chipset_tag_t cc" \ | | 81 | .Fn cardbus_get_capability "cardbus_chipset_tag_t cc" \ |
84 | "cardbus_function_tag_t cf" "pcitag_t tag" "int capid" \ | | 82 | "cardbus_function_tag_t cf" "pcitag_t tag" "int capid" \ |
85 | "int *offsetp" "pcireg_t *valuep" | | 83 | "int *offsetp" "pcireg_t *valuep" |
86 | .Ft pcitag_t | | 84 | .Ft pcitag_t |
87 | .Fn cardbus_make_tag "cardbus_chipset_tag_t cc" "int cf" "int bus" \ | | 85 | .Fn cardbus_make_tag "cardbus_chipset_tag_t cc" "int cf" "int bus" \ |
88 | "int device" "int function" | | 86 | "int device" "int function" |
89 | .Ft void | | | |
90 | .Fn cardbus_free_tag "cardbus_chipset_tag_t cc" "int cf" \ | | | |
91 | "pcitag_t tag" | | | |
92 | .Ft pcireg_t | | 87 | .Ft pcireg_t |
93 | .Fn cardbus_conf_read "cardbus_chipset_tag_t cc" "int cf" \ | | 88 | .Fn cardbus_conf_read "cardbus_chipset_tag_t cc" "int cf" \ |
94 | "pcitag_t tag" "int offs" | | 89 | "pcitag_t tag" "int offs" |
95 | .Ft void | | 90 | .Ft void |
96 | .Fn cardbus_conf_write "cardbus_chipset_tag_t cc" "int cf" \ | | 91 | .Fn cardbus_conf_write "cardbus_chipset_tag_t cc" "int cf" \ |
97 | "pcitag_t tag" "int offs" "busreg_t val" | | 92 | "pcitag_t tag" "int offs" "busreg_t val" |
98 | .Ft void * | | 93 | .Ft void * |
99 | .Fn cardbus_intr_establish "cardbus_chipset_tag_t cc" \ | | 94 | .Fn cardbus_intr_establish "cardbus_chipset_tag_t cc" \ |
100 | "cardbus_function_tag_t cf" "cardbus_intr_handle_t irq" "int level" \ | | 95 | "cardbus_function_tag_t cf" "cardbus_intr_handle_t irq" "int level" \ |
101 | "int (*handler)(void *)" "void *arg" | | 96 | "int (*handler)(void *)" "void *arg" |
102 | .Ft void | | 97 | .Ft void |
103 | .Fn cardbus_intr_disestablish "cardbus_chipset_tag_t cc" \ | | 98 | .Fn cardbus_intr_disestablish "cardbus_chipset_tag_t cc" \ |
104 | "cardbus_function_tag_t cf" "void *ih" | | 99 | "cardbus_function_tag_t cf" "void *ih" |
| @@ -110,28 +105,26 @@ | | | @@ -110,28 +105,26 @@ |
110 | .Fn Cardbus_function_enable "cardbus_devfunc_t ct" | | 105 | .Fn Cardbus_function_enable "cardbus_devfunc_t ct" |
111 | .Ft int | | 106 | .Ft int |
112 | .Fn Cardbus_function_disable "cardbus_devfunc_t ct" | | 107 | .Fn Cardbus_function_disable "cardbus_devfunc_t ct" |
113 | .Ft int | | 108 | .Ft int |
114 | .Fn Cardbus_mapreg_map "cardbus_devfunc_t ct" "int reg" \ | | 109 | .Fn Cardbus_mapreg_map "cardbus_devfunc_t ct" "int reg" \ |
115 | "pcireg_t type" "int busflags" "bus_space_tag_t *tagp" \ | | 110 | "pcireg_t type" "int busflags" "bus_space_tag_t *tagp" \ |
116 | "bus_space_handle_t *handlep" "bus_addr_t *basep" "bus_size_t *sizep" | | 111 | "bus_space_handle_t *handlep" "bus_addr_t *basep" "bus_size_t *sizep" |
117 | .Ft int | | 112 | .Ft int |
118 | .Fn Cardbus_mapreg_unmap "cardbus_devfunc_t ct" \ | | 113 | .Fn Cardbus_mapreg_unmap "cardbus_devfunc_t ct" \ |
119 | "int reg" "bus_space_tag_t tag" "bus_space_handle_t handle" \ | | 114 | "int reg" "bus_space_tag_t tag" "bus_space_handle_t handle" \ |
120 | "bus_size_t size" | | 115 | "bus_size_t size" |
121 | .Ft pcitag_t | | 116 | .Ft pcitag_t |
122 | .Fn Cardbus_make_tag "cardbus_devfunc_t ct " | | 117 | .Fn Cardbus_make_tag "cardbus_devfunc_t ct " |
123 | .Ft void | | | |
124 | .Fn Cardbus_free_tag "cardbus_devfunc_t ct" "pcitag_t tag" | | | |
125 | .Ft pcireg_t | | 118 | .Ft pcireg_t |
126 | .Fn Cardbus_conf_read "cardbus_devfunc_t ct" "pcitag_t tag" \ | | 119 | .Fn Cardbus_conf_read "cardbus_devfunc_t ct" "pcitag_t tag" \ |
127 | "int offs" | | 120 | "int offs" |
128 | .Ft void | | 121 | .Ft void |
129 | .Fn Cardbus_conf_write "cardbus_devfunc_t ct" "pcitag_t tag" \ | | 122 | .Fn Cardbus_conf_write "cardbus_devfunc_t ct" "pcitag_t tag" \ |
130 | "int offs" "busreg_t val" | | 123 | "int offs" "busreg_t val" |
131 | .Sh DESCRIPTION | | 124 | .Sh DESCRIPTION |
132 | The machine-independent | | 125 | The machine-independent |
133 | .Nm | | 126 | .Nm |
134 | subsystem provides support for CardBus devices. | | 127 | subsystem provides support for CardBus devices. |
135 | .Pp | | 128 | .Pp |
136 | The CardBus interface is an improvement to the PC-Card interface | | 129 | The CardBus interface is an improvement to the PC-Card interface |
137 | supported by | | 130 | supported by |
| @@ -218,30 +211,26 @@ is the offset of the BAR register. | | | @@ -218,30 +211,26 @@ is the offset of the BAR register. |
218 | .It Fn cardbus_get_capability "cc" "cf" "tag" "capid" "offsetp" "valuep" | | 211 | .It Fn cardbus_get_capability "cc" "cf" "tag" "capid" "offsetp" "valuep" |
219 | Find the PCI capability for the device function | | 212 | Find the PCI capability for the device function |
220 | .Fa cf | | 213 | .Fa cf |
221 | specified by | | 214 | specified by |
222 | .Fa capid . | | 215 | .Fa capid . |
223 | Returns the capability in | | 216 | Returns the capability in |
224 | .Fa offsetp | | 217 | .Fa offsetp |
225 | and | | 218 | and |
226 | .Fa valuep . | | 219 | .Fa valuep . |
227 | .It Fn cardbus_make_tag "cc" "cf" "bus" "device" "function" | | 220 | .It Fn cardbus_make_tag "cc" "cf" "bus" "device" "function" |
228 | Make a tag to access config space of a CardBus card. | | 221 | Make a tag to access config space of a CardBus card. |
229 | It works the same as | | 222 | It works the same as |
230 | .Fn pci_make_tag . | | 223 | .Fn pci_make_tag . |
231 | .It Fn cardbus_free_tag "cc" "cf" "tag" | | | |
232 | Release a tag used to access the config space of a CardBus card. | | | |
233 | It works the same as | | | |
234 | .Fn pci_free_tag . | | | |
235 | .It Fn cardbus_conf_read "cc" "cf" "tag" "offs" | | 224 | .It Fn cardbus_conf_read "cc" "cf" "tag" "offs" |
236 | Read the config space of a CardBus card. | | 225 | Read the config space of a CardBus card. |
237 | It works the same as | | 226 | It works the same as |
238 | .Fn pci_conf_read . | | 227 | .Fn pci_conf_read . |
239 | .It Fn cardbus_conf_write "cc" "cf" "tag" "offs" "val" | | 228 | .It Fn cardbus_conf_write "cc" "cf" "tag" "offs" "val" |
240 | Write to the config space of a CardBus card. | | 229 | Write to the config space of a CardBus card. |
241 | It works same as | | 230 | It works same as |
242 | .Fn pci_conf_write . | | 231 | .Fn pci_conf_write . |
243 | .It Fn cardbus_intr_establish "cc" "cf" "irq" "level" "handler" "arg" | | 232 | .It Fn cardbus_intr_establish "cc" "cf" "irq" "level" "handler" "arg" |
244 | Establish an interrupt handler for device function | | 233 | Establish an interrupt handler for device function |
245 | .Fa cf . | | 234 | .Fa cf . |
246 | The priority of the interrupt is specified by | | 235 | The priority of the interrupt is specified by |
247 | .Fa level . | | 236 | .Fa level . |