2 * IBM Hot Plug Controller Driver
4 * Written By: Tong Yu, IBM Corporation
6 * Copyright (C) 2001,2003 Greg Kroah-Hartman (greg@kroah.com)
7 * Copyright (C) 2001-2003 IBM Corp.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or (at
14 * your option) any later version.
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
19 * NON INFRINGEMENT. See the GNU General Public License for more
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 * Send feedback to <gregkh@us.ibm.com>
30 #include <linux/module.h>
31 #include <linux/sched.h>
32 #include <linux/errno.h>
34 #include <linux/slab.h>
35 #include <linux/pci.h>
36 #include <linux/list.h>
37 #include <linux/init.h>
41 * POST builds data blocks(in this data block definition, a char-1
42 * byte, short(or word)-2 byte, long(dword)-4 byte) in the Extended
43 * BIOS Data Area which describe the configuration of the hot-plug
44 * controllers and resources used by the PCI Hot-Plug devices.
46 * This file walks EBDA, maps data block from physical addr,
47 * reconstruct linked lists about all system resource(MEM, PFM, IO)
48 * already assigned by POST, as well as linked lists about hot plug
49 * controllers (ctlr#, slot#, bus&slot features...)
53 LIST_HEAD (ibmphp_ebda_pci_rsrc_head
);
54 LIST_HEAD (ibmphp_slot_head
);
57 static struct ebda_hpc_list
*hpc_list_ptr
;
58 static struct ebda_rsrc_list
*rsrc_list_ptr
;
59 static struct rio_table_hdr
*rio_table_ptr
= NULL
;
60 static LIST_HEAD (ebda_hpc_head
);
61 static LIST_HEAD (bus_info_head
);
62 static LIST_HEAD (rio_vg_head
);
63 static LIST_HEAD (rio_lo_head
);
64 static LIST_HEAD (opt_vg_head
);
65 static LIST_HEAD (opt_lo_head
);
66 static void __iomem
*io_mem
;
69 static int ebda_rsrc_controller (void);
70 static int ebda_rsrc_rsrc (void);
71 static int ebda_rio_table (void);
73 static struct ebda_hpc_list
* __init
alloc_ebda_hpc_list (void)
75 struct ebda_hpc_list
*list
;
77 list
= kmalloc (sizeof (struct ebda_hpc_list
), GFP_KERNEL
);
80 memset (list
, 0, sizeof (*list
));
84 static struct controller
*alloc_ebda_hpc (u32 slot_count
, u32 bus_count
)
86 struct controller
*controller
;
87 struct ebda_hpc_slot
*slots
;
88 struct ebda_hpc_bus
*buses
;
90 controller
= kmalloc (sizeof (struct controller
), GFP_KERNEL
);
93 memset (controller
, 0, sizeof (*controller
));
95 slots
= kmalloc (sizeof (struct ebda_hpc_slot
) * slot_count
, GFP_KERNEL
);
98 memset (slots
, 0, sizeof (*slots
) * slot_count
);
99 controller
->slots
= slots
;
101 buses
= kmalloc (sizeof (struct ebda_hpc_bus
) * bus_count
, GFP_KERNEL
);
104 memset (buses
, 0, sizeof (*buses
) * bus_count
);
105 controller
->buses
= buses
;
109 kfree(controller
->slots
);
116 static void free_ebda_hpc (struct controller
*controller
)
118 kfree (controller
->slots
);
119 kfree (controller
->buses
);
123 static struct ebda_rsrc_list
* __init
alloc_ebda_rsrc_list (void)
125 struct ebda_rsrc_list
*list
;
127 list
= kmalloc (sizeof (struct ebda_rsrc_list
), GFP_KERNEL
);
130 memset (list
, 0, sizeof (*list
));
134 static struct ebda_pci_rsrc
*alloc_ebda_pci_rsrc (void)
136 struct ebda_pci_rsrc
*resource
;
138 resource
= kmalloc (sizeof (struct ebda_pci_rsrc
), GFP_KERNEL
);
141 memset (resource
, 0, sizeof (*resource
));
145 static void __init
print_bus_info (void)
147 struct bus_info
*ptr
;
148 struct list_head
*ptr1
;
150 list_for_each (ptr1
, &bus_info_head
) {
151 ptr
= list_entry (ptr1
, struct bus_info
, bus_info_list
);
152 debug ("%s - slot_min = %x\n", __FUNCTION__
, ptr
->slot_min
);
153 debug ("%s - slot_max = %x\n", __FUNCTION__
, ptr
->slot_max
);
154 debug ("%s - slot_count = %x\n", __FUNCTION__
, ptr
->slot_count
);
155 debug ("%s - bus# = %x\n", __FUNCTION__
, ptr
->busno
);
156 debug ("%s - current_speed = %x\n", __FUNCTION__
, ptr
->current_speed
);
157 debug ("%s - controller_id = %x\n", __FUNCTION__
, ptr
->controller_id
);
159 debug ("%s - slots_at_33_conv = %x\n", __FUNCTION__
, ptr
->slots_at_33_conv
);
160 debug ("%s - slots_at_66_conv = %x\n", __FUNCTION__
, ptr
->slots_at_66_conv
);
161 debug ("%s - slots_at_66_pcix = %x\n", __FUNCTION__
, ptr
->slots_at_66_pcix
);
162 debug ("%s - slots_at_100_pcix = %x\n", __FUNCTION__
, ptr
->slots_at_100_pcix
);
163 debug ("%s - slots_at_133_pcix = %x\n", __FUNCTION__
, ptr
->slots_at_133_pcix
);
168 static void print_lo_info (void)
170 struct rio_detail
*ptr
;
171 struct list_head
*ptr1
;
172 debug ("print_lo_info ----\n");
173 list_for_each (ptr1
, &rio_lo_head
) {
174 ptr
= list_entry (ptr1
, struct rio_detail
, rio_detail_list
);
175 debug ("%s - rio_node_id = %x\n", __FUNCTION__
, ptr
->rio_node_id
);
176 debug ("%s - rio_type = %x\n", __FUNCTION__
, ptr
->rio_type
);
177 debug ("%s - owner_id = %x\n", __FUNCTION__
, ptr
->owner_id
);
178 debug ("%s - first_slot_num = %x\n", __FUNCTION__
, ptr
->first_slot_num
);
179 debug ("%s - wpindex = %x\n", __FUNCTION__
, ptr
->wpindex
);
180 debug ("%s - chassis_num = %x\n", __FUNCTION__
, ptr
->chassis_num
);
185 static void print_vg_info (void)
187 struct rio_detail
*ptr
;
188 struct list_head
*ptr1
;
189 debug ("%s ---\n", __FUNCTION__
);
190 list_for_each (ptr1
, &rio_vg_head
) {
191 ptr
= list_entry (ptr1
, struct rio_detail
, rio_detail_list
);
192 debug ("%s - rio_node_id = %x\n", __FUNCTION__
, ptr
->rio_node_id
);
193 debug ("%s - rio_type = %x\n", __FUNCTION__
, ptr
->rio_type
);
194 debug ("%s - owner_id = %x\n", __FUNCTION__
, ptr
->owner_id
);
195 debug ("%s - first_slot_num = %x\n", __FUNCTION__
, ptr
->first_slot_num
);
196 debug ("%s - wpindex = %x\n", __FUNCTION__
, ptr
->wpindex
);
197 debug ("%s - chassis_num = %x\n", __FUNCTION__
, ptr
->chassis_num
);
202 static void __init
print_ebda_pci_rsrc (void)
204 struct ebda_pci_rsrc
*ptr
;
205 struct list_head
*ptr1
;
207 list_for_each (ptr1
, &ibmphp_ebda_pci_rsrc_head
) {
208 ptr
= list_entry (ptr1
, struct ebda_pci_rsrc
, ebda_pci_rsrc_list
);
209 debug ("%s - rsrc type: %x bus#: %x dev_func: %x start addr: %x end addr: %x\n",
210 __FUNCTION__
, ptr
->rsrc_type
,ptr
->bus_num
, ptr
->dev_fun
,ptr
->start_addr
, ptr
->end_addr
);
214 static void __init
print_ibm_slot (void)
217 struct list_head
*ptr1
;
219 list_for_each (ptr1
, &ibmphp_slot_head
) {
220 ptr
= list_entry (ptr1
, struct slot
, ibm_slot_list
);
221 debug ("%s - slot_number: %x\n", __FUNCTION__
, ptr
->number
);
225 static void __init
print_opt_vg (void)
228 struct list_head
*ptr1
;
229 debug ("%s ---\n", __FUNCTION__
);
230 list_for_each (ptr1
, &opt_vg_head
) {
231 ptr
= list_entry (ptr1
, struct opt_rio
, opt_rio_list
);
232 debug ("%s - rio_type %x\n", __FUNCTION__
, ptr
->rio_type
);
233 debug ("%s - chassis_num: %x\n", __FUNCTION__
, ptr
->chassis_num
);
234 debug ("%s - first_slot_num: %x\n", __FUNCTION__
, ptr
->first_slot_num
);
235 debug ("%s - middle_num: %x\n", __FUNCTION__
, ptr
->middle_num
);
239 static void __init
print_ebda_hpc (void)
241 struct controller
*hpc_ptr
;
242 struct list_head
*ptr1
;
245 list_for_each (ptr1
, &ebda_hpc_head
) {
247 hpc_ptr
= list_entry (ptr1
, struct controller
, ebda_hpc_list
);
249 for (index
= 0; index
< hpc_ptr
->slot_count
; index
++) {
250 debug ("%s - physical slot#: %x\n", __FUNCTION__
, hpc_ptr
->slots
[index
].slot_num
);
251 debug ("%s - pci bus# of the slot: %x\n", __FUNCTION__
, hpc_ptr
->slots
[index
].slot_bus_num
);
252 debug ("%s - index into ctlr addr: %x\n", __FUNCTION__
, hpc_ptr
->slots
[index
].ctl_index
);
253 debug ("%s - cap of the slot: %x\n", __FUNCTION__
, hpc_ptr
->slots
[index
].slot_cap
);
256 for (index
= 0; index
< hpc_ptr
->bus_count
; index
++) {
257 debug ("%s - bus# of each bus controlled by this ctlr: %x\n", __FUNCTION__
, hpc_ptr
->buses
[index
].bus_num
);
260 debug ("%s - type of hpc: %x\n", __FUNCTION__
, hpc_ptr
->ctlr_type
);
261 switch (hpc_ptr
->ctlr_type
) {
263 debug ("%s - bus: %x\n", __FUNCTION__
, hpc_ptr
->u
.pci_ctlr
.bus
);
264 debug ("%s - dev_fun: %x\n", __FUNCTION__
, hpc_ptr
->u
.pci_ctlr
.dev_fun
);
265 debug ("%s - irq: %x\n", __FUNCTION__
, hpc_ptr
->irq
);
269 debug ("%s - io_start: %x\n", __FUNCTION__
, hpc_ptr
->u
.isa_ctlr
.io_start
);
270 debug ("%s - io_end: %x\n", __FUNCTION__
, hpc_ptr
->u
.isa_ctlr
.io_end
);
271 debug ("%s - irq: %x\n", __FUNCTION__
, hpc_ptr
->irq
);
276 debug ("%s - wpegbbar: %lx\n", __FUNCTION__
, hpc_ptr
->u
.wpeg_ctlr
.wpegbbar
);
277 debug ("%s - i2c_addr: %x\n", __FUNCTION__
, hpc_ptr
->u
.wpeg_ctlr
.i2c_addr
);
278 debug ("%s - irq: %x\n", __FUNCTION__
, hpc_ptr
->irq
);
284 int __init
ibmphp_access_ebda (void)
286 u8 format
, num_ctlrs
, rio_complete
, hs_complete
;
287 u16 ebda_seg
, num_entries
, next_offset
, offset
, blk_id
, sub_addr
, re
, rc_id
, re_id
, base
;
294 io_mem
= ioremap ((0x40 << 4) + 0x0e, 2);
297 ebda_seg
= readw (io_mem
);
299 debug ("returned ebda segment: %x\n", ebda_seg
);
301 io_mem
= ioremap (ebda_seg
<<4, 65000);
307 offset
= next_offset
;
308 next_offset
= readw (io_mem
+ offset
); /* offset of next blk */
311 if (next_offset
== 0) /* 0 indicate it's last blk */
313 blk_id
= readw (io_mem
+ offset
); /* this blk id */
316 /* check if it is hot swap block or rio block */
317 if (blk_id
!= 0x4853 && blk_id
!= 0x4752)
320 if (blk_id
== 0x4853) {
321 debug ("now enter hot swap block---\n");
322 debug ("hot blk id: %x\n", blk_id
);
323 format
= readb (io_mem
+ offset
);
328 debug ("hot blk format: %x\n", format
);
329 /* hot swap sub blk */
333 re
= readw (io_mem
+ sub_addr
); /* next sub blk */
336 rc_id
= readw (io_mem
+ sub_addr
); /* sub blk id */
341 /* rc sub blk signature */
342 num_ctlrs
= readb (io_mem
+ sub_addr
);
345 hpc_list_ptr
= alloc_ebda_hpc_list ();
350 hpc_list_ptr
->format
= format
;
351 hpc_list_ptr
->num_ctlrs
= num_ctlrs
;
352 hpc_list_ptr
->phys_addr
= sub_addr
; /* offset of RSRC_CONTROLLER blk */
353 debug ("info about hpc descriptor---\n");
354 debug ("hot blk format: %x\n", format
);
355 debug ("num of controller: %x\n", num_ctlrs
);
356 debug ("offset of hpc data structure enteries: %x\n ", sub_addr
);
358 sub_addr
= base
+ re
; /* re sub blk */
359 /* FIXME: rc is never used/checked */
360 rc
= readw (io_mem
+ sub_addr
); /* next sub blk */
363 re_id
= readw (io_mem
+ sub_addr
); /* sub blk id */
369 /* signature of re */
370 num_entries
= readw (io_mem
+ sub_addr
);
372 sub_addr
+= 2; /* offset of RSRC_ENTRIES blk */
373 rsrc_list_ptr
= alloc_ebda_rsrc_list ();
374 if (!rsrc_list_ptr
) {
378 rsrc_list_ptr
->format
= format
;
379 rsrc_list_ptr
->num_entries
= num_entries
;
380 rsrc_list_ptr
->phys_addr
= sub_addr
;
382 debug ("info about rsrc descriptor---\n");
383 debug ("format: %x\n", format
);
384 debug ("num of rsrc: %x\n", num_entries
);
385 debug ("offset of rsrc data structure enteries: %x\n ", sub_addr
);
389 /* found rio table, blk_id == 0x4752 */
390 debug ("now enter io table ---\n");
391 debug ("rio blk id: %x\n", blk_id
);
393 rio_table_ptr
= kmalloc (sizeof (struct rio_table_hdr
), GFP_KERNEL
);
396 memset (rio_table_ptr
, 0, sizeof (struct rio_table_hdr
) );
397 rio_table_ptr
->ver_num
= readb (io_mem
+ offset
);
398 rio_table_ptr
->scal_count
= readb (io_mem
+ offset
+ 1);
399 rio_table_ptr
->riodev_count
= readb (io_mem
+ offset
+ 2);
400 rio_table_ptr
->offset
= offset
+3 ;
402 debug("info about rio table hdr ---\n");
403 debug("ver_num: %x\nscal_count: %x\nriodev_count: %x\noffset of rio table: %x\n ",
404 rio_table_ptr
->ver_num
, rio_table_ptr
->scal_count
,
405 rio_table_ptr
->riodev_count
, rio_table_ptr
->offset
);
411 if (!hs_complete
&& !rio_complete
)
415 if (rio_complete
&& rio_table_ptr
->ver_num
== 3) {
416 rc
= ebda_rio_table ();
421 rc
= ebda_rsrc_controller ();
425 rc
= ebda_rsrc_rsrc ();
435 * map info of scalability details and rio details from physical address
437 static int __init
ebda_rio_table (void)
441 struct rio_detail
*rio_detail_ptr
;
443 offset
= rio_table_ptr
->offset
;
444 offset
+= 12 * rio_table_ptr
->scal_count
;
446 // we do concern about rio details
447 for (i
= 0; i
< rio_table_ptr
->riodev_count
; i
++) {
448 rio_detail_ptr
= kmalloc (sizeof (struct rio_detail
), GFP_KERNEL
);
451 memset (rio_detail_ptr
, 0, sizeof (struct rio_detail
));
452 rio_detail_ptr
->rio_node_id
= readb (io_mem
+ offset
);
453 rio_detail_ptr
->bbar
= readl (io_mem
+ offset
+ 1);
454 rio_detail_ptr
->rio_type
= readb (io_mem
+ offset
+ 5);
455 rio_detail_ptr
->owner_id
= readb (io_mem
+ offset
+ 6);
456 rio_detail_ptr
->port0_node_connect
= readb (io_mem
+ offset
+ 7);
457 rio_detail_ptr
->port0_port_connect
= readb (io_mem
+ offset
+ 8);
458 rio_detail_ptr
->port1_node_connect
= readb (io_mem
+ offset
+ 9);
459 rio_detail_ptr
->port1_port_connect
= readb (io_mem
+ offset
+ 10);
460 rio_detail_ptr
->first_slot_num
= readb (io_mem
+ offset
+ 11);
461 rio_detail_ptr
->status
= readb (io_mem
+ offset
+ 12);
462 rio_detail_ptr
->wpindex
= readb (io_mem
+ offset
+ 13);
463 rio_detail_ptr
->chassis_num
= readb (io_mem
+ offset
+ 14);
464 // debug ("rio_node_id: %x\nbbar: %x\nrio_type: %x\nowner_id: %x\nport0_node: %x\nport0_port: %x\nport1_node: %x\nport1_port: %x\nfirst_slot_num: %x\nstatus: %x\n", rio_detail_ptr->rio_node_id, rio_detail_ptr->bbar, rio_detail_ptr->rio_type, rio_detail_ptr->owner_id, rio_detail_ptr->port0_node_connect, rio_detail_ptr->port0_port_connect, rio_detail_ptr->port1_node_connect, rio_detail_ptr->port1_port_connect, rio_detail_ptr->first_slot_num, rio_detail_ptr->status);
465 //create linked list of chassis
466 if (rio_detail_ptr
->rio_type
== 4 || rio_detail_ptr
->rio_type
== 5)
467 list_add (&rio_detail_ptr
->rio_detail_list
, &rio_vg_head
);
468 //create linked list of expansion box
469 else if (rio_detail_ptr
->rio_type
== 6 || rio_detail_ptr
->rio_type
== 7)
470 list_add (&rio_detail_ptr
->rio_detail_list
, &rio_lo_head
);
473 kfree (rio_detail_ptr
);
482 * reorganizing linked list of chassis
484 static struct opt_rio
*search_opt_vg (u8 chassis_num
)
487 struct list_head
*ptr1
;
488 list_for_each (ptr1
, &opt_vg_head
) {
489 ptr
= list_entry (ptr1
, struct opt_rio
, opt_rio_list
);
490 if (ptr
->chassis_num
== chassis_num
)
496 static int __init
combine_wpg_for_chassis (void)
498 struct opt_rio
*opt_rio_ptr
= NULL
;
499 struct rio_detail
*rio_detail_ptr
= NULL
;
500 struct list_head
*list_head_ptr
= NULL
;
502 list_for_each (list_head_ptr
, &rio_vg_head
) {
503 rio_detail_ptr
= list_entry (list_head_ptr
, struct rio_detail
, rio_detail_list
);
504 opt_rio_ptr
= search_opt_vg (rio_detail_ptr
->chassis_num
);
506 opt_rio_ptr
= (struct opt_rio
*) kmalloc (sizeof (struct opt_rio
), GFP_KERNEL
);
509 memset (opt_rio_ptr
, 0, sizeof (struct opt_rio
));
510 opt_rio_ptr
->rio_type
= rio_detail_ptr
->rio_type
;
511 opt_rio_ptr
->chassis_num
= rio_detail_ptr
->chassis_num
;
512 opt_rio_ptr
->first_slot_num
= rio_detail_ptr
->first_slot_num
;
513 opt_rio_ptr
->middle_num
= rio_detail_ptr
->first_slot_num
;
514 list_add (&opt_rio_ptr
->opt_rio_list
, &opt_vg_head
);
516 opt_rio_ptr
->first_slot_num
= min (opt_rio_ptr
->first_slot_num
, rio_detail_ptr
->first_slot_num
);
517 opt_rio_ptr
->middle_num
= max (opt_rio_ptr
->middle_num
, rio_detail_ptr
->first_slot_num
);
525 * reorgnizing linked list of expansion box
527 static struct opt_rio_lo
*search_opt_lo (u8 chassis_num
)
529 struct opt_rio_lo
*ptr
;
530 struct list_head
*ptr1
;
531 list_for_each (ptr1
, &opt_lo_head
) {
532 ptr
= list_entry (ptr1
, struct opt_rio_lo
, opt_rio_lo_list
);
533 if (ptr
->chassis_num
== chassis_num
)
539 static int combine_wpg_for_expansion (void)
541 struct opt_rio_lo
*opt_rio_lo_ptr
= NULL
;
542 struct rio_detail
*rio_detail_ptr
= NULL
;
543 struct list_head
*list_head_ptr
= NULL
;
545 list_for_each (list_head_ptr
, &rio_lo_head
) {
546 rio_detail_ptr
= list_entry (list_head_ptr
, struct rio_detail
, rio_detail_list
);
547 opt_rio_lo_ptr
= search_opt_lo (rio_detail_ptr
->chassis_num
);
548 if (!opt_rio_lo_ptr
) {
549 opt_rio_lo_ptr
= (struct opt_rio_lo
*) kmalloc (sizeof (struct opt_rio_lo
), GFP_KERNEL
);
552 memset (opt_rio_lo_ptr
, 0, sizeof (struct opt_rio_lo
));
553 opt_rio_lo_ptr
->rio_type
= rio_detail_ptr
->rio_type
;
554 opt_rio_lo_ptr
->chassis_num
= rio_detail_ptr
->chassis_num
;
555 opt_rio_lo_ptr
->first_slot_num
= rio_detail_ptr
->first_slot_num
;
556 opt_rio_lo_ptr
->middle_num
= rio_detail_ptr
->first_slot_num
;
557 opt_rio_lo_ptr
->pack_count
= 1;
559 list_add (&opt_rio_lo_ptr
->opt_rio_lo_list
, &opt_lo_head
);
561 opt_rio_lo_ptr
->first_slot_num
= min (opt_rio_lo_ptr
->first_slot_num
, rio_detail_ptr
->first_slot_num
);
562 opt_rio_lo_ptr
->middle_num
= max (opt_rio_lo_ptr
->middle_num
, rio_detail_ptr
->first_slot_num
);
563 opt_rio_lo_ptr
->pack_count
= 2;
570 /* Since we don't know the max slot number per each chassis, hence go
571 * through the list of all chassis to find out the range
572 * Arguments: slot_num, 1st slot number of the chassis we think we are on,
573 * var (0 = chassis, 1 = expansion box)
575 static int first_slot_num (u8 slot_num
, u8 first_slot
, u8 var
)
577 struct opt_rio
*opt_vg_ptr
= NULL
;
578 struct opt_rio_lo
*opt_lo_ptr
= NULL
;
579 struct list_head
*ptr
= NULL
;
583 list_for_each (ptr
, &opt_vg_head
) {
584 opt_vg_ptr
= list_entry (ptr
, struct opt_rio
, opt_rio_list
);
585 if ((first_slot
< opt_vg_ptr
->first_slot_num
) && (slot_num
>= opt_vg_ptr
->first_slot_num
)) {
591 list_for_each (ptr
, &opt_lo_head
) {
592 opt_lo_ptr
= list_entry (ptr
, struct opt_rio_lo
, opt_rio_lo_list
);
593 if ((first_slot
< opt_lo_ptr
->first_slot_num
) && (slot_num
>= opt_lo_ptr
->first_slot_num
)) {
602 static struct opt_rio_lo
* find_rxe_num (u8 slot_num
)
604 struct opt_rio_lo
*opt_lo_ptr
;
605 struct list_head
*ptr
;
607 list_for_each (ptr
, &opt_lo_head
) {
608 opt_lo_ptr
= list_entry (ptr
, struct opt_rio_lo
, opt_rio_lo_list
);
609 //check to see if this slot_num belongs to expansion box
610 if ((slot_num
>= opt_lo_ptr
->first_slot_num
) && (!first_slot_num (slot_num
, opt_lo_ptr
->first_slot_num
, 1)))
616 static struct opt_rio
* find_chassis_num (u8 slot_num
)
618 struct opt_rio
*opt_vg_ptr
;
619 struct list_head
*ptr
;
621 list_for_each (ptr
, &opt_vg_head
) {
622 opt_vg_ptr
= list_entry (ptr
, struct opt_rio
, opt_rio_list
);
623 //check to see if this slot_num belongs to chassis
624 if ((slot_num
>= opt_vg_ptr
->first_slot_num
) && (!first_slot_num (slot_num
, opt_vg_ptr
->first_slot_num
, 0)))
630 /* This routine will find out how many slots are in the chassis, so that
631 * the slot numbers for rxe100 would start from 1, and not from 7, or 6 etc
633 static u8
calculate_first_slot (u8 slot_num
)
636 struct list_head
* list
;
637 struct slot
* slot_cur
;
639 list_for_each (list
, &ibmphp_slot_head
) {
640 slot_cur
= list_entry (list
, struct slot
, ibm_slot_list
);
641 if (slot_cur
->ctrl
) {
642 if ((slot_cur
->ctrl
->ctlr_type
!= 4) && (slot_cur
->ctrl
->ending_slot_num
> first_slot
) && (slot_num
> slot_cur
->ctrl
->ending_slot_num
))
643 first_slot
= slot_cur
->ctrl
->ending_slot_num
;
646 return first_slot
+ 1;
649 static char *create_file_name (struct slot
* slot_cur
)
651 struct opt_rio
*opt_vg_ptr
= NULL
;
652 struct opt_rio_lo
*opt_lo_ptr
= NULL
;
654 int which
= 0; /* rxe = 1, chassis = 0 */
655 u8 number
= 1; /* either chassis or rxe # */
661 err ("Structure passed is empty\n");
665 slot_num
= slot_cur
->number
;
667 memset (str
, 0, sizeof(str
));
670 if (rio_table_ptr
->ver_num
== 3) {
671 opt_vg_ptr
= find_chassis_num (slot_num
);
672 opt_lo_ptr
= find_rxe_num (slot_num
);
677 if ((slot_num
- opt_vg_ptr
->first_slot_num
) > (slot_num
- opt_lo_ptr
->first_slot_num
)) {
678 number
= opt_lo_ptr
->chassis_num
;
679 first_slot
= opt_lo_ptr
->first_slot_num
;
680 which
= 1; /* it is RXE */
682 first_slot
= opt_vg_ptr
->first_slot_num
;
683 number
= opt_vg_ptr
->chassis_num
;
687 first_slot
= opt_vg_ptr
->first_slot_num
;
688 number
= opt_vg_ptr
->chassis_num
;
692 } else if (opt_lo_ptr
) {
693 number
= opt_lo_ptr
->chassis_num
;
694 first_slot
= opt_lo_ptr
->first_slot_num
;
697 } else if (rio_table_ptr
) {
698 if (rio_table_ptr
->ver_num
== 3) {
699 /* if both NULL and we DO have correct RIO table in BIOS */
704 if (slot_cur
->ctrl
->ctlr_type
== 4) {
705 first_slot
= calculate_first_slot (slot_num
);
712 sprintf(str
, "%s%dslot%d",
713 which
== 0 ? "chassis" : "rxe",
714 number
, slot_num
- first_slot
+ 1);
718 static int fillslotinfo(struct hotplug_slot
*hotplug_slot
)
723 if (!hotplug_slot
|| !hotplug_slot
->private)
726 slot
= hotplug_slot
->private;
727 rc
= ibmphp_hpc_readslot(slot
, READ_ALLSTAT
, NULL
);
731 // power - enabled:1 not:0
732 hotplug_slot
->info
->power_status
= SLOT_POWER(slot
->status
);
734 // attention - off:0, on:1, blinking:2
735 hotplug_slot
->info
->attention_status
= SLOT_ATTN(slot
->status
, slot
->ext_status
);
737 // latch - open:1 closed:0
738 hotplug_slot
->info
->latch_status
= SLOT_LATCH(slot
->status
);
740 // pci board - present:1 not:0
741 if (SLOT_PRESENT (slot
->status
))
742 hotplug_slot
->info
->adapter_status
= 1;
744 hotplug_slot
->info
->adapter_status
= 0;
746 if (slot->bus_on->supported_bus_mode
747 && (slot->bus_on->supported_speed == BUS_SPEED_66))
748 hotplug_slot->info->max_bus_speed_status = BUS_SPEED_66PCIX;
750 hotplug_slot->info->max_bus_speed_status = slot->bus_on->supported_speed;
756 static void release_slot(struct hotplug_slot
*hotplug_slot
)
760 if (!hotplug_slot
|| !hotplug_slot
->private)
763 slot
= hotplug_slot
->private;
764 kfree(slot
->hotplug_slot
->info
);
765 kfree(slot
->hotplug_slot
->name
);
766 kfree(slot
->hotplug_slot
);
770 /* we don't want to actually remove the resources, since free_resources will do just that */
771 ibmphp_unconfigure_card(&slot
, -1);
776 static struct pci_driver ibmphp_driver
;
779 * map info (ctlr-id, slot count, slot#.. bus count, bus#, ctlr type...) of
780 * each hpc from physical address to a list of hot plug controllers based on
783 static int __init
ebda_rsrc_controller (void)
785 u16 addr
, addr_slot
, addr_bus
;
786 u8 ctlr_id
, temp
, bus_index
;
788 u16 slot_num
, bus_num
, index
;
789 struct hotplug_slot
*hp_slot_ptr
;
790 struct controller
*hpc_ptr
;
791 struct ebda_hpc_bus
*bus_ptr
;
792 struct ebda_hpc_slot
*slot_ptr
;
793 struct bus_info
*bus_info_ptr1
, *bus_info_ptr2
;
795 struct slot
*tmp_slot
;
796 struct list_head
*list
;
798 addr
= hpc_list_ptr
->phys_addr
;
799 for (ctlr
= 0; ctlr
< hpc_list_ptr
->num_ctlrs
; ctlr
++) {
801 ctlr_id
= readb (io_mem
+ addr
);
803 slot_num
= readb (io_mem
+ addr
);
806 addr_slot
= addr
; /* offset of slot structure */
807 addr
+= (slot_num
* 4);
809 bus_num
= readb (io_mem
+ addr
);
812 addr_bus
= addr
; /* offset of bus */
813 addr
+= (bus_num
* 9); /* offset of ctlr_type */
814 temp
= readb (io_mem
+ addr
);
817 /* init hpc structure */
818 hpc_ptr
= alloc_ebda_hpc (slot_num
, bus_num
);
823 hpc_ptr
->ctlr_id
= ctlr_id
;
824 hpc_ptr
->ctlr_relative_id
= ctlr
;
825 hpc_ptr
->slot_count
= slot_num
;
826 hpc_ptr
->bus_count
= bus_num
;
827 debug ("now enter ctlr data struture ---\n");
828 debug ("ctlr id: %x\n", ctlr_id
);
829 debug ("ctlr_relative_id: %x\n", hpc_ptr
->ctlr_relative_id
);
830 debug ("count of slots controlled by this ctlr: %x\n", slot_num
);
831 debug ("count of buses controlled by this ctlr: %x\n", bus_num
);
833 /* init slot structure, fetch slot, bus, cap... */
834 slot_ptr
= hpc_ptr
->slots
;
835 for (slot
= 0; slot
< slot_num
; slot
++) {
836 slot_ptr
->slot_num
= readb (io_mem
+ addr_slot
);
837 slot_ptr
->slot_bus_num
= readb (io_mem
+ addr_slot
+ slot_num
);
838 slot_ptr
->ctl_index
= readb (io_mem
+ addr_slot
+ 2*slot_num
);
839 slot_ptr
->slot_cap
= readb (io_mem
+ addr_slot
+ 3*slot_num
);
841 // create bus_info lined list --- if only one slot per bus: slot_min = slot_max
843 bus_info_ptr2
= ibmphp_find_same_bus_num (slot_ptr
->slot_bus_num
);
844 if (!bus_info_ptr2
) {
845 bus_info_ptr1
= (struct bus_info
*) kmalloc (sizeof (struct bus_info
), GFP_KERNEL
);
846 if (!bus_info_ptr1
) {
848 goto error_no_hp_slot
;
850 memset (bus_info_ptr1
, 0, sizeof (struct bus_info
));
851 bus_info_ptr1
->slot_min
= slot_ptr
->slot_num
;
852 bus_info_ptr1
->slot_max
= slot_ptr
->slot_num
;
853 bus_info_ptr1
->slot_count
+= 1;
854 bus_info_ptr1
->busno
= slot_ptr
->slot_bus_num
;
855 bus_info_ptr1
->index
= bus_index
++;
856 bus_info_ptr1
->current_speed
= 0xff;
857 bus_info_ptr1
->current_bus_mode
= 0xff;
859 bus_info_ptr1
->controller_id
= hpc_ptr
->ctlr_id
;
861 list_add_tail (&bus_info_ptr1
->bus_info_list
, &bus_info_head
);
864 bus_info_ptr2
->slot_min
= min (bus_info_ptr2
->slot_min
, slot_ptr
->slot_num
);
865 bus_info_ptr2
->slot_max
= max (bus_info_ptr2
->slot_max
, slot_ptr
->slot_num
);
866 bus_info_ptr2
->slot_count
+= 1;
870 // end of creating the bus_info linked list
876 /* init bus structure */
877 bus_ptr
= hpc_ptr
->buses
;
878 for (bus
= 0; bus
< bus_num
; bus
++) {
879 bus_ptr
->bus_num
= readb (io_mem
+ addr_bus
+ bus
);
880 bus_ptr
->slots_at_33_conv
= readb (io_mem
+ addr_bus
+ bus_num
+ 8 * bus
);
881 bus_ptr
->slots_at_66_conv
= readb (io_mem
+ addr_bus
+ bus_num
+ 8 * bus
+ 1);
883 bus_ptr
->slots_at_66_pcix
= readb (io_mem
+ addr_bus
+ bus_num
+ 8 * bus
+ 2);
885 bus_ptr
->slots_at_100_pcix
= readb (io_mem
+ addr_bus
+ bus_num
+ 8 * bus
+ 3);
887 bus_ptr
->slots_at_133_pcix
= readb (io_mem
+ addr_bus
+ bus_num
+ 8 * bus
+ 4);
889 bus_info_ptr2
= ibmphp_find_same_bus_num (bus_ptr
->bus_num
);
891 bus_info_ptr2
->slots_at_33_conv
= bus_ptr
->slots_at_33_conv
;
892 bus_info_ptr2
->slots_at_66_conv
= bus_ptr
->slots_at_66_conv
;
893 bus_info_ptr2
->slots_at_66_pcix
= bus_ptr
->slots_at_66_pcix
;
894 bus_info_ptr2
->slots_at_100_pcix
= bus_ptr
->slots_at_100_pcix
;
895 bus_info_ptr2
->slots_at_133_pcix
= bus_ptr
->slots_at_133_pcix
;
900 hpc_ptr
->ctlr_type
= temp
;
902 switch (hpc_ptr
->ctlr_type
) {
904 hpc_ptr
->u
.pci_ctlr
.bus
= readb (io_mem
+ addr
);
905 hpc_ptr
->u
.pci_ctlr
.dev_fun
= readb (io_mem
+ addr
+ 1);
906 hpc_ptr
->irq
= readb (io_mem
+ addr
+ 2);
908 debug ("ctrl bus = %x, ctlr devfun = %x, irq = %x\n",
909 hpc_ptr
->u
.pci_ctlr
.bus
,
910 hpc_ptr
->u
.pci_ctlr
.dev_fun
, hpc_ptr
->irq
);
914 hpc_ptr
->u
.isa_ctlr
.io_start
= readw (io_mem
+ addr
);
915 hpc_ptr
->u
.isa_ctlr
.io_end
= readw (io_mem
+ addr
+ 2);
916 if (!request_region (hpc_ptr
->u
.isa_ctlr
.io_start
,
917 (hpc_ptr
->u
.isa_ctlr
.io_end
- hpc_ptr
->u
.isa_ctlr
.io_start
+ 1),
920 goto error_no_hp_slot
;
922 hpc_ptr
->irq
= readb (io_mem
+ addr
+ 4);
928 hpc_ptr
->u
.wpeg_ctlr
.wpegbbar
= readl (io_mem
+ addr
);
929 hpc_ptr
->u
.wpeg_ctlr
.i2c_addr
= readb (io_mem
+ addr
+ 4);
930 hpc_ptr
->irq
= readb (io_mem
+ addr
+ 5);
935 goto error_no_hp_slot
;
938 //reorganize chassis' linked list
939 combine_wpg_for_chassis ();
940 combine_wpg_for_expansion ();
941 hpc_ptr
->revision
= 0xff;
942 hpc_ptr
->options
= 0xff;
943 hpc_ptr
->starting_slot_num
= hpc_ptr
->slots
[0].slot_num
;
944 hpc_ptr
->ending_slot_num
= hpc_ptr
->slots
[slot_num
-1].slot_num
;
946 // register slots with hpc core as well as create linked list of ibm slot
947 for (index
= 0; index
< hpc_ptr
->slot_count
; index
++) {
949 hp_slot_ptr
= kmalloc(sizeof(*hp_slot_ptr
), GFP_KERNEL
);
952 goto error_no_hp_slot
;
954 memset(hp_slot_ptr
, 0, sizeof(*hp_slot_ptr
));
956 hp_slot_ptr
->info
= kmalloc (sizeof(struct hotplug_slot_info
), GFP_KERNEL
);
957 if (!hp_slot_ptr
->info
) {
959 goto error_no_hp_info
;
961 memset(hp_slot_ptr
->info
, 0, sizeof(struct hotplug_slot_info
));
963 hp_slot_ptr
->name
= kmalloc(30, GFP_KERNEL
);
964 if (!hp_slot_ptr
->name
) {
966 goto error_no_hp_name
;
969 tmp_slot
= kmalloc(sizeof(*tmp_slot
), GFP_KERNEL
);
974 memset(tmp_slot
, 0, sizeof(*tmp_slot
));
976 tmp_slot
->flag
= TRUE
;
978 tmp_slot
->capabilities
= hpc_ptr
->slots
[index
].slot_cap
;
979 if ((hpc_ptr
->slots
[index
].slot_cap
& EBDA_SLOT_133_MAX
) == EBDA_SLOT_133_MAX
)
980 tmp_slot
->supported_speed
= 3;
981 else if ((hpc_ptr
->slots
[index
].slot_cap
& EBDA_SLOT_100_MAX
) == EBDA_SLOT_100_MAX
)
982 tmp_slot
->supported_speed
= 2;
983 else if ((hpc_ptr
->slots
[index
].slot_cap
& EBDA_SLOT_66_MAX
) == EBDA_SLOT_66_MAX
)
984 tmp_slot
->supported_speed
= 1;
986 if ((hpc_ptr
->slots
[index
].slot_cap
& EBDA_SLOT_PCIX_CAP
) == EBDA_SLOT_PCIX_CAP
)
987 tmp_slot
->supported_bus_mode
= 1;
989 tmp_slot
->supported_bus_mode
= 0;
992 tmp_slot
->bus
= hpc_ptr
->slots
[index
].slot_bus_num
;
994 bus_info_ptr1
= ibmphp_find_same_bus_num (hpc_ptr
->slots
[index
].slot_bus_num
);
995 if (!bus_info_ptr1
) {
999 tmp_slot
->bus_on
= bus_info_ptr1
;
1000 bus_info_ptr1
= NULL
;
1001 tmp_slot
->ctrl
= hpc_ptr
;
1003 tmp_slot
->ctlr_index
= hpc_ptr
->slots
[index
].ctl_index
;
1004 tmp_slot
->number
= hpc_ptr
->slots
[index
].slot_num
;
1005 tmp_slot
->hotplug_slot
= hp_slot_ptr
;
1007 hp_slot_ptr
->private = tmp_slot
;
1008 hp_slot_ptr
->release
= release_slot
;
1010 rc
= fillslotinfo(hp_slot_ptr
);
1014 rc
= ibmphp_init_devno ((struct slot
**) &hp_slot_ptr
->private);
1017 hp_slot_ptr
->ops
= &ibmphp_hotplug_slot_ops
;
1019 // end of registering ibm slot with hotplug core
1021 list_add (& ((struct slot
*)(hp_slot_ptr
->private))->ibm_slot_list
, &ibmphp_slot_head
);
1025 list_add (&hpc_ptr
->ebda_hpc_list
, &ebda_hpc_head
);
1029 list_for_each (list
, &ibmphp_slot_head
) {
1030 tmp_slot
= list_entry (list
, struct slot
, ibm_slot_list
);
1032 snprintf (tmp_slot
->hotplug_slot
->name
, 30, "%s", create_file_name (tmp_slot
));
1033 pci_hp_register (tmp_slot
->hotplug_slot
);
1041 kfree (hp_slot_ptr
->private);
1043 kfree (hp_slot_ptr
->name
);
1045 kfree (hp_slot_ptr
->info
);
1047 kfree (hp_slot_ptr
);
1049 free_ebda_hpc (hpc_ptr
);
1056 * map info (bus, devfun, start addr, end addr..) of i/o, memory,
1057 * pfm from the physical addr to a list of resource.
1059 static int __init
ebda_rsrc_rsrc (void)
1064 struct ebda_pci_rsrc
*rsrc_ptr
;
1066 addr
= rsrc_list_ptr
->phys_addr
;
1067 debug ("now entering rsrc land\n");
1068 debug ("offset of rsrc: %x\n", rsrc_list_ptr
->phys_addr
);
1070 for (rsrc
= 0; rsrc
< rsrc_list_ptr
->num_entries
; rsrc
++) {
1071 type
= readb (io_mem
+ addr
);
1074 rsrc_type
= type
& EBDA_RSRC_TYPE_MASK
;
1076 if (rsrc_type
== EBDA_IO_RSRC_TYPE
) {
1077 rsrc_ptr
= alloc_ebda_pci_rsrc ();
1082 rsrc_ptr
->rsrc_type
= type
;
1084 rsrc_ptr
->bus_num
= readb (io_mem
+ addr
);
1085 rsrc_ptr
->dev_fun
= readb (io_mem
+ addr
+ 1);
1086 rsrc_ptr
->start_addr
= readw (io_mem
+ addr
+ 2);
1087 rsrc_ptr
->end_addr
= readw (io_mem
+ addr
+ 4);
1090 debug ("rsrc from io type ----\n");
1091 debug ("rsrc type: %x bus#: %x dev_func: %x start addr: %x end addr: %x\n",
1092 rsrc_ptr
->rsrc_type
, rsrc_ptr
->bus_num
, rsrc_ptr
->dev_fun
, rsrc_ptr
->start_addr
, rsrc_ptr
->end_addr
);
1094 list_add (&rsrc_ptr
->ebda_pci_rsrc_list
, &ibmphp_ebda_pci_rsrc_head
);
1097 if (rsrc_type
== EBDA_MEM_RSRC_TYPE
|| rsrc_type
== EBDA_PFM_RSRC_TYPE
) {
1098 rsrc_ptr
= alloc_ebda_pci_rsrc ();
1103 rsrc_ptr
->rsrc_type
= type
;
1105 rsrc_ptr
->bus_num
= readb (io_mem
+ addr
);
1106 rsrc_ptr
->dev_fun
= readb (io_mem
+ addr
+ 1);
1107 rsrc_ptr
->start_addr
= readl (io_mem
+ addr
+ 2);
1108 rsrc_ptr
->end_addr
= readl (io_mem
+ addr
+ 6);
1111 debug ("rsrc from mem or pfm ---\n");
1112 debug ("rsrc type: %x bus#: %x dev_func: %x start addr: %x end addr: %x\n",
1113 rsrc_ptr
->rsrc_type
, rsrc_ptr
->bus_num
, rsrc_ptr
->dev_fun
, rsrc_ptr
->start_addr
, rsrc_ptr
->end_addr
);
1115 list_add (&rsrc_ptr
->ebda_pci_rsrc_list
, &ibmphp_ebda_pci_rsrc_head
);
1118 kfree (rsrc_list_ptr
);
1119 rsrc_list_ptr
= NULL
;
1120 print_ebda_pci_rsrc ();
1124 u16
ibmphp_get_total_controllers (void)
1126 return hpc_list_ptr
->num_ctlrs
;
1129 struct slot
*ibmphp_get_slot_from_physical_num (u8 physical_num
)
1132 struct list_head
*list
;
1134 list_for_each (list
, &ibmphp_slot_head
) {
1135 slot
= list_entry (list
, struct slot
, ibm_slot_list
);
1136 if (slot
->number
== physical_num
)
1143 * - the smallest slot number
1144 * - the largest slot number
1145 * - the total number of the slots based on each bus
1146 * (if only one slot per bus slot_min = slot_max )
1148 struct bus_info
*ibmphp_find_same_bus_num (u32 num
)
1150 struct bus_info
*ptr
;
1151 struct list_head
*ptr1
;
1153 list_for_each (ptr1
, &bus_info_head
) {
1154 ptr
= list_entry (ptr1
, struct bus_info
, bus_info_list
);
1155 if (ptr
->busno
== num
)
1161 /* Finding relative bus number, in order to map corresponding
1164 int ibmphp_get_bus_index (u8 num
)
1166 struct bus_info
*ptr
;
1167 struct list_head
*ptr1
;
1169 list_for_each (ptr1
, &bus_info_head
) {
1170 ptr
= list_entry (ptr1
, struct bus_info
, bus_info_list
);
1171 if (ptr
->busno
== num
)
1177 void ibmphp_free_bus_info_queue (void)
1179 struct bus_info
*bus_info
;
1180 struct list_head
*list
;
1181 struct list_head
*next
;
1183 list_for_each_safe (list
, next
, &bus_info_head
) {
1184 bus_info
= list_entry (list
, struct bus_info
, bus_info_list
);
1189 void ibmphp_free_ebda_hpc_queue (void)
1191 struct controller
*controller
= NULL
;
1192 struct list_head
*list
;
1193 struct list_head
*next
;
1196 list_for_each_safe (list
, next
, &ebda_hpc_head
) {
1197 controller
= list_entry (list
, struct controller
, ebda_hpc_list
);
1198 if (controller
->ctlr_type
== 0)
1199 release_region (controller
->u
.isa_ctlr
.io_start
, (controller
->u
.isa_ctlr
.io_end
- controller
->u
.isa_ctlr
.io_start
+ 1));
1200 else if ((controller
->ctlr_type
== 1) && (!pci_flag
)) {
1202 pci_unregister_driver (&ibmphp_driver
);
1204 free_ebda_hpc (controller
);
1208 void ibmphp_free_ebda_pci_rsrc_queue (void)
1210 struct ebda_pci_rsrc
*resource
;
1211 struct list_head
*list
;
1212 struct list_head
*next
;
1214 list_for_each_safe (list
, next
, &ibmphp_ebda_pci_rsrc_head
) {
1215 resource
= list_entry (list
, struct ebda_pci_rsrc
, ebda_pci_rsrc_list
);
1221 static struct pci_device_id id_table
[] = {
1223 .vendor
= PCI_VENDOR_ID_IBM
,
1224 .device
= HPC_DEVICE_ID
,
1225 .subvendor
= PCI_VENDOR_ID_IBM
,
1226 .subdevice
= HPC_SUBSYSTEM_ID
,
1227 .class = ((PCI_CLASS_SYSTEM_PCI_HOTPLUG
<< 8) | 0x00),
1231 MODULE_DEVICE_TABLE(pci
, id_table
);
1233 static int ibmphp_probe (struct pci_dev
*, const struct pci_device_id
*);
1234 static struct pci_driver ibmphp_driver
= {
1236 .id_table
= id_table
,
1237 .probe
= ibmphp_probe
,
1240 int ibmphp_register_pci (void)
1242 struct controller
*ctrl
;
1243 struct list_head
*tmp
;
1246 list_for_each (tmp
, &ebda_hpc_head
) {
1247 ctrl
= list_entry (tmp
, struct controller
, ebda_hpc_list
);
1248 if (ctrl
->ctlr_type
== 1) {
1249 rc
= pci_register_driver(&ibmphp_driver
);
1255 static int ibmphp_probe (struct pci_dev
* dev
, const struct pci_device_id
*ids
)
1257 struct controller
*ctrl
;
1258 struct list_head
*tmp
;
1260 debug ("inside ibmphp_probe\n");
1262 list_for_each (tmp
, &ebda_hpc_head
) {
1263 ctrl
= list_entry (tmp
, struct controller
, ebda_hpc_list
);
1264 if (ctrl
->ctlr_type
== 1) {
1265 if ((dev
->devfn
== ctrl
->u
.pci_ctlr
.dev_fun
) && (dev
->bus
->number
== ctrl
->u
.pci_ctlr
.bus
)) {
1266 ctrl
->ctrl_dev
= dev
;
1267 debug ("found device!!!\n");
1268 debug ("dev->device = %x, dev->subsystem_device = %x\n", dev
->device
, dev
->subsystem_device
);