#include #define PCI_EXP_SLTSTA_PDS 0x0040 /* Presence Detect State */
#define PCI_EXP_SLTSTA_PDC 0x0008 /* Presence Detect Changed */
#define PCI_EXP_SLTSTA 26 /* Slot Status */
#define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */
#define POWER_OFF PCI_EXP_SLTCTL_PCC
#define PCI_EXP_SLTCTL 24 /* Slot Control */
static struct pci_dev *dev;
static struct pci_bus *bus;
static int domain = 0x0000;
static int busnr = 0;
module_param(domain, int, 0644);
module_param(busnr, int, 0644);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("GuZheng cengku@gmail.com");
static int __init pcie_conf_init(void)
{
int retval = 0;
u16 slot_ctrl;
u16 slot_cmd;
u16 cmd_mask;
bus = pci_find_bus(domain, busnr);
if (!bus) {