ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / pci / hotplug / pci_hotplug_core.c
1 /*
2  * PCI HotPlug Controller Core
3  *
4  * Copyright (C) 2001-2002 Greg Kroah-Hartman (greg@kroah.com)
5  * Copyright (C) 2001-2002 IBM Corp.
6  *
7  * All rights reserved.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or (at
12  * your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
17  * NON INFRINGEMENT.  See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  *
24  * Send feedback to <greg@kroah.com>
25  *
26  * Filesystem portion based on work done by Pat Mochel on ddfs/driverfs
27  *
28  */
29
30 #include <linux/config.h>
31 #include <linux/module.h>
32 #include <linux/kernel.h>
33 #include <linux/types.h>
34 #include <linux/list.h>
35 #include <linux/pagemap.h>
36 #include <linux/slab.h>
37 #include <linux/smp_lock.h>
38 #include <linux/init.h>
39 #include <linux/mount.h>
40 #include <linux/namei.h>
41 #include <linux/pci.h>
42 #include <asm/uaccess.h>
43 #include <linux/kobject.h>
44 #include <linux/sysfs.h>
45 #include "pci_hotplug.h"
46
47
48 #if !defined(CONFIG_HOTPLUG_PCI_MODULE)
49         #define MY_NAME "pci_hotplug"
50 #else
51         #define MY_NAME THIS_MODULE->name
52 #endif
53
54 #define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __FUNCTION__ , ## arg); } while (0)
55 #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
56 #define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
57 #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
58
59
60 /* local variables */
61 static int debug;
62
63 #define DRIVER_VERSION  "0.5"
64 #define DRIVER_AUTHOR   "Greg Kroah-Hartman <greg@kroah.com>, Scott Murray <scottm@somanetworks.com>"
65 #define DRIVER_DESC     "PCI Hot Plug PCI Core"
66
67
68 //////////////////////////////////////////////////////////////////
69
70 static LIST_HEAD(pci_hotplug_slot_list);
71
72 struct subsystem pci_hotplug_slots_subsys;
73
74 static ssize_t hotplug_slot_attr_show(struct kobject *kobj,
75                 struct attribute *attr, char *buf)
76 {
77         struct hotplug_slot *slot = to_hotplug_slot(kobj);
78         struct hotplug_slot_attribute *attribute = to_hotplug_attr(attr);
79         return attribute->show ? attribute->show(slot, buf) : 0;
80 }
81
82 static ssize_t hotplug_slot_attr_store(struct kobject *kobj,
83                 struct attribute *attr, const char *buf, size_t len)
84 {
85         struct hotplug_slot *slot = to_hotplug_slot(kobj);
86         struct hotplug_slot_attribute *attribute = to_hotplug_attr(attr);
87         return attribute->store ? attribute->store(slot, buf, len) : 0;
88 }
89
90 static struct sysfs_ops hotplug_slot_sysfs_ops = {
91         .show = hotplug_slot_attr_show,
92         .store = hotplug_slot_attr_store,
93 };
94
95 static void hotplug_slot_release(struct kobject *kobj)
96 {
97         struct hotplug_slot *slot = to_hotplug_slot(kobj);
98         if (slot->release)
99                 slot->release(slot);
100 }
101
102 static struct kobj_type hotplug_slot_ktype = {
103         .sysfs_ops = &hotplug_slot_sysfs_ops,
104         .release = &hotplug_slot_release,
105 };
106
107 decl_subsys_name(pci_hotplug_slots, slots, &hotplug_slot_ktype, NULL);
108
109 /* these strings match up with the values in pci_bus_speed */
110 static char *pci_bus_speed_strings[] = {
111         "33 MHz PCI",           /* 0x00 */
112         "66 MHz PCI",           /* 0x01 */
113         "66 MHz PCIX",          /* 0x02 */
114         "100 MHz PCIX",         /* 0x03 */
115         "133 MHz PCIX",         /* 0x04 */
116         NULL,                   /* 0x05 */
117         NULL,                   /* 0x06 */
118         NULL,                   /* 0x07 */
119         NULL,                   /* 0x08 */
120         "66 MHz PCIX 266",      /* 0x09 */
121         "100 MHz PCIX 266",     /* 0x0a */
122         "133 MHz PCIX 266",     /* 0x0b */
123         NULL,                   /* 0x0c */
124         NULL,                   /* 0x0d */
125         NULL,                   /* 0x0e */
126         NULL,                   /* 0x0f */
127         NULL,                   /* 0x10 */
128         "66 MHz PCIX 533",      /* 0x11 */
129         "100 MHz PCIX 533",     /* 0x12 */
130         "133 MHz PCIX 533",     /* 0x13 */
131         "25 GBps PCI-E",        /* 0x14 */
132 };
133
134 #ifdef CONFIG_HOTPLUG_PCI_CPCI
135 extern int cpci_hotplug_init(int debug);
136 extern void cpci_hotplug_exit(void);
137 #else
138 static inline int cpci_hotplug_init(int debug) { return 0; }
139 static inline void cpci_hotplug_exit(void) { }
140 #endif
141
142 /* Weee, fun with macros... */
143 #define GET_STATUS(name,type)   \
144 static int get_##name (struct hotplug_slot *slot, type *value)          \
145 {                                                                       \
146         struct hotplug_slot_ops *ops = slot->ops;                       \
147         int retval = 0;                                                 \
148         if (try_module_get(ops->owner)) {                               \
149                 if (ops->get_##name)                                    \
150                         retval = ops->get_##name (slot, value);         \
151                 else                                                    \
152                         *value = slot->info->name;                      \
153                 module_put(ops->owner);                                 \
154         }                                                               \
155         return retval;                                                  \
156 }
157
158 GET_STATUS(power_status, u8)
159 GET_STATUS(attention_status, u8)
160 GET_STATUS(latch_status, u8)
161 GET_STATUS(adapter_status, u8)
162 GET_STATUS(address, u32)
163 GET_STATUS(max_bus_speed, enum pci_bus_speed)
164 GET_STATUS(cur_bus_speed, enum pci_bus_speed)
165
166 static ssize_t power_read_file (struct hotplug_slot *slot, char *buf)
167 {
168         int retval;
169         u8 value;
170
171         retval = get_power_status (slot, &value);
172         if (retval)
173                 goto exit;
174         retval = sprintf (buf, "%d\n", value);
175 exit:
176         return retval;
177 }
178
179 static ssize_t power_write_file (struct hotplug_slot *slot, const char *buf,
180                 size_t count)
181 {
182         unsigned long lpower;
183         u8 power;
184         int retval = 0;
185
186         lpower = simple_strtoul (buf, NULL, 10);
187         power = (u8)(lpower & 0xff);
188         dbg ("power = %d\n", power);
189
190         if (!try_module_get(slot->ops->owner)) {
191                 retval = -ENODEV;
192                 goto exit;
193         }
194         switch (power) {
195                 case 0:
196                         if (slot->ops->disable_slot)
197                                 retval = slot->ops->disable_slot(slot);
198                         break;
199
200                 case 1:
201                         if (slot->ops->enable_slot)
202                                 retval = slot->ops->enable_slot(slot);
203                         break;
204
205                 default:
206                         err ("Illegal value specified for power\n");
207                         retval = -EINVAL;
208         }
209         module_put(slot->ops->owner);
210
211 exit:   
212         if (retval)
213                 return retval;
214         return count;
215 }
216
217 static struct hotplug_slot_attribute hotplug_slot_attr_power = {
218         .attr = {.name = "power", .mode = S_IFREG | S_IRUGO | S_IWUSR},
219         .show = power_read_file,
220         .store = power_write_file
221 };
222
223 static ssize_t attention_read_file (struct hotplug_slot *slot, char *buf)
224 {
225         int retval;
226         u8 value;
227
228         retval = get_attention_status (slot, &value);
229         if (retval)
230                 goto exit;
231         retval = sprintf (buf, "%d\n", value);
232
233 exit:
234         return retval;
235 }
236
237 static ssize_t attention_write_file (struct hotplug_slot *slot, const char *buf,
238                 size_t count)
239 {
240         unsigned long lattention;
241         u8 attention;
242         int retval = 0;
243
244         lattention = simple_strtoul (buf, NULL, 10);
245         attention = (u8)(lattention & 0xff);
246         dbg (" - attention = %d\n", attention);
247
248         if (!try_module_get(slot->ops->owner)) {
249                 retval = -ENODEV;
250                 goto exit;
251         }
252         if (slot->ops->set_attention_status)
253                 retval = slot->ops->set_attention_status(slot, attention);
254         module_put(slot->ops->owner);
255
256 exit:   
257         if (retval)
258                 return retval;
259         return count;
260 }
261
262 static struct hotplug_slot_attribute hotplug_slot_attr_attention = {
263         .attr = {.name = "attention", .mode = S_IFREG | S_IRUGO | S_IWUSR},
264         .show = attention_read_file,
265         .store = attention_write_file
266 };
267
268 static ssize_t latch_read_file (struct hotplug_slot *slot, char *buf)
269 {
270         int retval;
271         u8 value;
272
273         retval = get_latch_status (slot, &value);
274         if (retval)
275                 goto exit;
276         retval = sprintf (buf, "%d\n", value);
277
278 exit:
279         return retval;
280 }
281
282 static struct hotplug_slot_attribute hotplug_slot_attr_latch = {
283         .attr = {.name = "latch", .mode = S_IFREG | S_IRUGO},
284         .show = latch_read_file,
285 };
286
287 static ssize_t presence_read_file (struct hotplug_slot *slot, char *buf)
288 {
289         int retval;
290         u8 value;
291
292         retval = get_adapter_status (slot, &value);
293         if (retval)
294                 goto exit;
295         retval = sprintf (buf, "%d\n", value);
296
297 exit:
298         return retval;
299 }
300
301 static struct hotplug_slot_attribute hotplug_slot_attr_presence = {
302         .attr = {.name = "adapter", .mode = S_IFREG | S_IRUGO},
303         .show = presence_read_file,
304 };
305
306 static ssize_t address_read_file (struct hotplug_slot *slot, char *buf)
307 {
308         int retval;
309         u32 address;
310
311         retval = get_address (slot, &address);
312         if (retval)
313                 goto exit;
314         retval = sprintf (buf, "%04x:%02x:%02x\n",
315                           (address >> 16) & 0xffff,
316                           (address >> 8) & 0xff,
317                           address & 0xff);
318
319 exit:
320         return retval;
321 }
322
323 static struct hotplug_slot_attribute hotplug_slot_attr_address = {
324         .attr = {.name = "address", .mode = S_IFREG | S_IRUGO},
325         .show = address_read_file,
326 };
327
328 static char *unknown_speed = "Unknown bus speed";
329
330 static ssize_t max_bus_speed_read_file (struct hotplug_slot *slot, char *buf)
331 {
332         char *speed_string;
333         int retval;
334         enum pci_bus_speed value;
335         
336         retval = get_max_bus_speed (slot, &value);
337         if (retval)
338                 goto exit;
339
340         if (value == PCI_SPEED_UNKNOWN)
341                 speed_string = unknown_speed;
342         else
343                 speed_string = pci_bus_speed_strings[value];
344         
345         retval = sprintf (buf, "%s\n", speed_string);
346
347 exit:
348         return retval;
349 }
350
351 static struct hotplug_slot_attribute hotplug_slot_attr_max_bus_speed = {
352         .attr = {.name = "max_bus_speed", .mode = S_IFREG | S_IRUGO},
353         .show = max_bus_speed_read_file,
354 };
355
356 static ssize_t cur_bus_speed_read_file (struct hotplug_slot *slot, char *buf)
357 {
358         char *speed_string;
359         int retval;
360         enum pci_bus_speed value;
361
362         retval = get_cur_bus_speed (slot, &value);
363         if (retval)
364                 goto exit;
365
366         if (value == PCI_SPEED_UNKNOWN)
367                 speed_string = unknown_speed;
368         else
369                 speed_string = pci_bus_speed_strings[value];
370         
371         retval = sprintf (buf, "%s\n", speed_string);
372
373 exit:
374         return retval;
375 }
376
377 static struct hotplug_slot_attribute hotplug_slot_attr_cur_bus_speed = {
378         .attr = {.name = "cur_bus_speed", .mode = S_IFREG | S_IRUGO},
379         .show = cur_bus_speed_read_file,
380 };
381
382 static ssize_t test_write_file (struct hotplug_slot *slot, const char *buf,
383                 size_t count)
384 {
385         unsigned long ltest;
386         u32 test;
387         int retval = 0;
388
389         ltest = simple_strtoul (buf, NULL, 10);
390         test = (u32)(ltest & 0xffffffff);
391         dbg ("test = %d\n", test);
392
393         if (!try_module_get(slot->ops->owner)) {
394                 retval = -ENODEV;
395                 goto exit;
396         }
397         if (slot->ops->hardware_test)
398                 retval = slot->ops->hardware_test(slot, test);
399         module_put(slot->ops->owner);
400
401 exit:   
402         if (retval)
403                 return retval;
404         return count;
405 }
406
407 static struct hotplug_slot_attribute hotplug_slot_attr_test = {
408         .attr = {.name = "test", .mode = S_IFREG | S_IRUGO | S_IWUSR},
409         .store = test_write_file
410 };
411
412 static int has_power_file (struct hotplug_slot *slot)
413 {
414         if ((!slot) || (!slot->ops))
415                 return -ENODEV;
416         if ((slot->ops->enable_slot) ||
417             (slot->ops->disable_slot) ||
418             (slot->ops->get_power_status))
419                 return 0;
420         return -ENOENT;
421 }
422
423 static int has_attention_file (struct hotplug_slot *slot)
424 {
425         if ((!slot) || (!slot->ops))
426                 return -ENODEV;
427         if ((slot->ops->set_attention_status) ||
428             (slot->ops->get_attention_status))
429                 return 0;
430         return -ENOENT;
431 }
432
433 static int has_latch_file (struct hotplug_slot *slot)
434 {
435         if ((!slot) || (!slot->ops))
436                 return -ENODEV;
437         if (slot->ops->get_latch_status)
438                 return 0;
439         return -ENOENT;
440 }
441
442 static int has_adapter_file (struct hotplug_slot *slot)
443 {
444         if ((!slot) || (!slot->ops))
445                 return -ENODEV;
446         if (slot->ops->get_adapter_status)
447                 return 0;
448         return -ENOENT;
449 }
450
451 static int has_address_file (struct hotplug_slot *slot)
452 {
453         if ((!slot) || (!slot->ops))
454                 return -ENODEV;
455         if (slot->ops->get_address)
456                 return 0;
457         return -ENOENT;
458 }
459
460 static int has_max_bus_speed_file (struct hotplug_slot *slot)
461 {
462         if ((!slot) || (!slot->ops))
463                 return -ENODEV;
464         if (slot->ops->get_max_bus_speed)
465                 return 0;
466         return -ENOENT;
467 }
468
469 static int has_cur_bus_speed_file (struct hotplug_slot *slot)
470 {
471         if ((!slot) || (!slot->ops))
472                 return -ENODEV;
473         if (slot->ops->get_cur_bus_speed)
474                 return 0;
475         return -ENOENT;
476 }
477
478 static int has_test_file (struct hotplug_slot *slot)
479 {
480         if ((!slot) || (!slot->ops))
481                 return -ENODEV;
482         if (slot->ops->hardware_test)
483                 return 0;
484         return -ENOENT;
485 }
486
487 static int fs_add_slot (struct hotplug_slot *slot)
488 {
489         if (has_power_file(slot) == 0)
490                 sysfs_create_file(&slot->kobj, &hotplug_slot_attr_power.attr);
491
492         if (has_attention_file(slot) == 0)
493                 sysfs_create_file(&slot->kobj, &hotplug_slot_attr_attention.attr);
494
495         if (has_latch_file(slot) == 0)
496                 sysfs_create_file(&slot->kobj, &hotplug_slot_attr_latch.attr);
497
498         if (has_adapter_file(slot) == 0)
499                 sysfs_create_file(&slot->kobj, &hotplug_slot_attr_presence.attr);
500
501         if (has_address_file(slot) == 0)
502                 sysfs_create_file(&slot->kobj, &hotplug_slot_attr_address.attr);
503
504         if (has_max_bus_speed_file(slot) == 0)
505                 sysfs_create_file(&slot->kobj, &hotplug_slot_attr_max_bus_speed.attr);
506
507         if (has_cur_bus_speed_file(slot) == 0)
508                 sysfs_create_file(&slot->kobj, &hotplug_slot_attr_cur_bus_speed.attr);
509
510         if (has_test_file(slot) == 0)
511                 sysfs_create_file(&slot->kobj, &hotplug_slot_attr_test.attr);
512
513         return 0;
514 }
515
516 static void fs_remove_slot (struct hotplug_slot *slot)
517 {
518         if (has_power_file(slot) == 0)
519                 sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_power.attr);
520
521         if (has_attention_file(slot) == 0)
522                 sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_attention.attr);
523
524         if (has_latch_file(slot) == 0)
525                 sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_latch.attr);
526
527         if (has_adapter_file(slot) == 0)
528                 sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_presence.attr);
529
530         if (has_address_file(slot) == 0)
531                 sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_address.attr);
532
533         if (has_max_bus_speed_file(slot) == 0)
534                 sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_max_bus_speed.attr);
535
536         if (has_cur_bus_speed_file(slot) == 0)
537                 sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_cur_bus_speed.attr);
538
539         if (has_test_file(slot) == 0)
540                 sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_test.attr);
541 }
542
543 static struct hotplug_slot *get_slot_from_name (const char *name)
544 {
545         struct hotplug_slot *slot;
546         struct list_head *tmp;
547
548         list_for_each (tmp, &pci_hotplug_slot_list) {
549                 slot = list_entry (tmp, struct hotplug_slot, slot_list);
550                 if (strcmp(slot->name, name) == 0)
551                         return slot;
552         }
553         return NULL;
554 }
555
556 /**
557  * pci_hp_register - register a hotplug_slot with the PCI hotplug subsystem
558  * @slot: pointer to the &struct hotplug_slot to register
559  *
560  * Registers a hotplug slot with the pci hotplug subsystem, which will allow
561  * userspace interaction to the slot.
562  *
563  * Returns 0 if successful, anything else for an error.
564  */
565 int pci_hp_register (struct hotplug_slot *slot)
566 {
567         int result;
568
569         if (slot == NULL)
570                 return -ENODEV;
571         if ((slot->info == NULL) || (slot->ops == NULL))
572                 return -EINVAL;
573
574         kobject_set_name(&slot->kobj, slot->name);
575         kobj_set_kset_s(slot, pci_hotplug_slots_subsys);
576
577         /* this can fail if we have already registered a slot with the same name */
578         if (kobject_register(&slot->kobj)) {
579                 err("Unable to register kobject");
580                 return -EINVAL;
581         }
582                 
583         list_add (&slot->slot_list, &pci_hotplug_slot_list);
584
585         result = fs_add_slot (slot);
586         dbg ("Added slot %s to the list\n", slot->name);
587         return result;
588 }
589
590 /**
591  * pci_hp_deregister - deregister a hotplug_slot with the PCI hotplug subsystem
592  * @slot: pointer to the &struct hotplug_slot to deregister
593  *
594  * The @slot must have been registered with the pci hotplug subsystem
595  * previously with a call to pci_hp_register().
596  *
597  * Returns 0 if successful, anything else for an error.
598  */
599 int pci_hp_deregister (struct hotplug_slot *slot)
600 {
601         struct hotplug_slot *temp;
602
603         if (slot == NULL)
604                 return -ENODEV;
605
606         temp = get_slot_from_name (slot->name);
607         if (temp != slot) {
608                 return -ENODEV;
609         }
610         list_del (&slot->slot_list);
611
612         fs_remove_slot (slot);
613         dbg ("Removed slot %s from the list\n", slot->name);
614         kobject_unregister(&slot->kobj);
615         return 0;
616 }
617
618 /**
619  * pci_hp_change_slot_info - changes the slot's information structure in the core
620  * @slot: pointer to the slot whose info has changed
621  * @info: pointer to the info copy into the slot's info structure
622  *
623  * @slot must have been registered with the pci 
624  * hotplug subsystem previously with a call to pci_hp_register().
625  *
626  * Returns 0 if successful, anything else for an error.
627  */
628 int pci_hp_change_slot_info (struct hotplug_slot *slot, struct hotplug_slot_info *info)
629 {
630         if ((slot == NULL) || (info == NULL))
631                 return -ENODEV;
632
633         /*
634         * check all fields in the info structure, and update timestamps
635         * for the files referring to the fields that have now changed.
636         */
637         if ((has_power_file(slot) == 0) &&
638             (slot->info->power_status != info->power_status))
639                 sysfs_update_file(&slot->kobj, &hotplug_slot_attr_power.attr);
640
641         if ((has_attention_file(slot) == 0) &&
642             (slot->info->attention_status != info->attention_status))
643                 sysfs_update_file(&slot->kobj, &hotplug_slot_attr_attention.attr);
644
645         if ((has_latch_file(slot) == 0) &&
646             (slot->info->latch_status != info->latch_status))
647                 sysfs_update_file(&slot->kobj, &hotplug_slot_attr_latch.attr);
648
649         if ((has_adapter_file(slot) == 0) &&
650             (slot->info->adapter_status != info->adapter_status))
651                 sysfs_update_file(&slot->kobj, &hotplug_slot_attr_presence.attr);
652
653         if ((has_address_file(slot) == 0) &&
654             (slot->info->address != info->address))
655                 sysfs_update_file(&slot->kobj, &hotplug_slot_attr_address.attr);
656
657         if ((has_max_bus_speed_file(slot) == 0) &&
658             (slot->info->max_bus_speed != info->max_bus_speed))
659                 sysfs_update_file(&slot->kobj, &hotplug_slot_attr_max_bus_speed.attr);
660
661         if ((has_cur_bus_speed_file(slot) == 0) &&
662             (slot->info->cur_bus_speed != info->cur_bus_speed))
663                 sysfs_update_file(&slot->kobj, &hotplug_slot_attr_cur_bus_speed.attr);
664
665         memcpy (slot->info, info, sizeof (struct hotplug_slot_info));
666
667         return 0;
668 }
669
670 static int __init pci_hotplug_init (void)
671 {
672         int result;
673
674         kset_set_kset_s(&pci_hotplug_slots_subsys, pci_bus_type.subsys);
675         result = subsystem_register(&pci_hotplug_slots_subsys);
676         if (result) {
677                 err("Register subsys with error %d\n", result);
678                 goto exit;
679         }
680         result = cpci_hotplug_init(debug);
681         if (result) {
682                 err ("cpci_hotplug_init with error %d\n", result);
683                 goto err_subsys;
684         }
685
686         info (DRIVER_DESC " version: " DRIVER_VERSION "\n");
687         goto exit;
688         
689 err_subsys:
690         subsystem_unregister(&pci_hotplug_slots_subsys);
691 exit:
692         return result;
693 }
694
695 static void __exit pci_hotplug_exit (void)
696 {
697         cpci_hotplug_exit();
698         subsystem_unregister(&pci_hotplug_slots_subsys);
699 }
700
701 module_init(pci_hotplug_init);
702 module_exit(pci_hotplug_exit);
703
704 MODULE_AUTHOR(DRIVER_AUTHOR);
705 MODULE_DESCRIPTION(DRIVER_DESC);
706 MODULE_LICENSE("GPL");
707 MODULE_PARM(debug, "i");
708 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
709
710 EXPORT_SYMBOL_GPL(pci_hotplug_slots_subsys);
711 EXPORT_SYMBOL_GPL(pci_hp_register);
712 EXPORT_SYMBOL_GPL(pci_hp_deregister);
713 EXPORT_SYMBOL_GPL(pci_hp_change_slot_info);