1csx_CS_DDI_Info(9F) Kernel Functions for Drivers csx_CS_DDI_Info(9F)
2
3
4
6 csx_CS_DDI_Info - obtain DDI information
7
9 #include <sys/pccard.h>
10
11
12
13 int32_t csx_CS_DDI_Info(cs_ddi_info_t *cdi);
14
15
17 Solaris DDI Specific (Solaris DDI)
18
20 cdi Pointer to a cs_ddi_info_t structure.
21
22
24 This function is a Solaris-specific extension that is used by clients
25 that need to provide the xx_getinfo driver entry point (see get‐
26 info(9E)). It provides a method for clients to obtain DDI information
27 based on their socket number and client driver name.
28
30 The structure members of cs_ddi_info_t are:
31
32 uint32_t Socket; /* socket number */
33 char* driver_name; /* unique driver name */
34 dev_info_t *dip; /* dip */
35 int32_t instance; /* instance */
36
37
38
39 The fields are defined as follows:
40
41 Socket This field must be set to the physical socket number
42 that the client is interested in getting information
43 about.
44
45
46 driver_name This field must be set to a string containing the name
47 of the client driver to get information about.
48
49
50
51 If csx_CS_DDI_Info() is used in a client's xx_getinfo function, then
52 the client will typically extract the Socket value from the *arg argu‐
53 ment and it must set the driver_name field to the same string used with
54 csx_RegisterClient(9F).
55
56
57 If the driver_name is found on the Socket, the csx_CS_DDI_Info() func‐
58 tion returns both the dev_info pointer and the instance fields for the
59 requested driver instance.
60
62 CS_SUCCESS Successful operation.
63
64
65 CS_BAD_SOCKET Client not found on Socket.
66
67
68 CS_UNSUPPORTED_FUNCTION No PCMCIA hardware installed.
69
70
72 This function may be called from user or kernel context.
73
75 Example 1 : Using csx_CS_DDI_Info
76
77
78 The following example shows how a client might call the
79 csx_CS_DDI_Info() in the client's xx_getinfo function to return the dip
80 or the instance number:
81
82
83 static int
84 pcepp_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg,
85 void **result)
86 {
87 int error = DDI_SUCCESS;
88 pcepp_state_t *pps;
89 cs_ddi_info_t cs_ddi_info;
90
91 switch (cmd) {
92
93 case DDI_INFO_DEVT2DEVINFO:
94 cs_ddi_info.Socket = getminor((dev_t)arg) & 0x3f;
95 cs_ddi_info.driver_name = pcepp_name;
96 if (csx_CS_DDI_Info(&cs_ddi_info) != CS_SUCCESS)
97 return (DDI_FAILURE);
98 if (!(pps = ddi_get_soft_state(pcepp_soft_state_p,
99 cs_ddi_info.instance))) {
100 *result = NULL;
101 } else {
102 *result = pps->dip;
103 }
104 break;
105
106 case DDI_INFO_DEVT2INSTANCE:
107 cs_ddi_info.Socket = getminor((dev_t)arg) & 0x3f;
108 cs_ddi_info.driver_name = pcepp_name;
109 if (csx_CS_DDI_Info(&cs_ddi_info) != CS_SUCCESS)
110 return (DDI_FAILURE);
111 *result = (void *)cs_ddi_info.instance;
112 break;
113
114 default:
115 error = DDI_FAILURE;
116 break;
117
118 }
119
120 return (error);
121 }
122
123
125 getinfo(9E), csx_RegisterClient(9F), ddi_get_instance(9F)
126
127
128 PC Card 95 Standard, PCMCIA/JEIDA
129
130
131
132SunOS 5.11 19 Jul 1996 csx_CS_DDI_Info(9F)