Commit b97490bf authored by Jeff Garzik's avatar Jeff Garzik

Merge mandrakesoft.com:/home/jgarzik/repo/linus-2.5

into mandrakesoft.com:/home/jgarzik/repo/net-drivers-2.5
parents b8f7f315 d103aab6
......@@ -305,8 +305,8 @@ struct controller {
u8 first_slot;
u8 add_support;
u8 push_flag;
u8 speed; /* 0 = 33MHz, 1 = 66MHz */
u8 speed_capability; /* 0 = 33MHz, 1 = 66MHz */
enum pci_bus_speed speed;
enum pci_bus_speed speed_capability;
u8 push_button; /* 0 = no pushbutton, 1 = pushbutton present */
u8 slot_switch_type; /* 0 = no switch, 1 = switch present */
u8 defeature_PHP; /* 0 = PHP not supported, 1 = PHP supported */
......@@ -321,9 +321,6 @@ struct controller {
wait_queue_head_t queue; /* sleep & wake process */
};
#define CTRL_SPEED_33MHz 0
#define CTRL_SPEED_66MHz 1
struct irq_mapping {
u8 barber_pole;
u8 valid_INT;
......@@ -635,7 +632,7 @@ static inline u8 get_controller_speed (struct controller *ctrl)
u16 misc;
misc = readw(ctrl->hpc_reg + MISC);
return (misc & 0x0800) ? 1 : 0;
return (misc & 0x0800) ? PCI_SPEED_66MHz : PCI_SPEED_33MHz;
}
......
......@@ -79,6 +79,8 @@ static int get_power_status (struct hotplug_slot *slot, u8 *value);
static int get_attention_status (struct hotplug_slot *slot, u8 *value);
static int get_latch_status (struct hotplug_slot *slot, u8 *value);
static int get_adapter_status (struct hotplug_slot *slot, u8 *value);
static int get_max_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value);
static int get_cur_bus_speed (struct hotplug_slot *slot, enum pci_bus_speed *value);
static struct hotplug_slot_ops cpqphp_hotplug_slot_ops = {
.owner = THIS_MODULE,
......@@ -90,6 +92,8 @@ static struct hotplug_slot_ops cpqphp_hotplug_slot_ops = {
.get_attention_status = get_attention_status,
.get_latch_status = get_latch_status,
.get_adapter_status = get_adapter_status,
.get_max_bus_speed = get_max_bus_speed,
.get_cur_bus_speed = get_cur_bus_speed,
};
......@@ -378,7 +382,7 @@ static int ctrl_slot_setup (struct controller * ctrl, void *smbios_start, void *
new_slot->capabilities |= PCISLOT_64_BIT_SUPPORTED;
if (is_slot66mhz(new_slot))
new_slot->capabilities |= PCISLOT_66_MHZ_SUPPORTED;
if (ctrl->speed == 1)
if (ctrl->speed == PCI_SPEED_66MHz)
new_slot->capabilities |= PCISLOT_66_MHZ_OPERATION;
ctrl_slot = slot_device - (readb(ctrl->hpc_reg + SLOT_MASK) >> 4);
......@@ -782,6 +786,44 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
return 0;
}
static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
{
struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
struct controller *ctrl;
if (slot == NULL)
return -ENODEV;
dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
ctrl = slot->ctrl;
if (ctrl == NULL)
return -ENODEV;
*value = ctrl->speed_capability;
return 0;
}
static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
{
struct slot *slot = get_slot (hotplug_slot, __FUNCTION__);
struct controller *ctrl;
if (slot == NULL)
return -ENODEV;
dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
ctrl = slot->ctrl;
if (ctrl == NULL)
return -ENODEV;
*value = ctrl->speed;
return 0;
}
static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
u8 num_of_slots = 0;
......@@ -853,28 +895,28 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
case PCI_SUB_HPC_ID:
/* Original 6500/7000 implementation */
ctrl->slot_switch_type = 1; // Switch is present
ctrl->speed_capability = CTRL_SPEED_33MHz;
ctrl->speed_capability = PCI_SPEED_33MHz;
ctrl->push_button = 0; // No pushbutton
ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported
ctrl->defeature_PHP = 1; // PHP is supported
ctrl->defeature_PHP = 1; // PHP is supported
ctrl->pcix_support = 0; // PCI-X not supported
ctrl->pcix_speed_capability = 0; // N/A since PCI-X not supported
ctrl->pcix_speed_capability = 0; // N/A since PCI-X not supported
break;
case PCI_SUB_HPC_ID2:
/* First Pushbutton implementation */
ctrl->push_flag = 1;
ctrl->slot_switch_type = 1; // Switch is present
ctrl->speed_capability = CTRL_SPEED_33MHz;
ctrl->speed_capability = PCI_SPEED_33MHz;
ctrl->push_button = 1; // Pushbutton is present
ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported
ctrl->defeature_PHP = 1; // PHP is supported
ctrl->defeature_PHP = 1; // PHP is supported
ctrl->pcix_support = 0; // PCI-X not supported
ctrl->pcix_speed_capability = 0; // N/A since PCI-X not supported
ctrl->pcix_speed_capability = 0; // N/A since PCI-X not supported
break;
case PCI_SUB_HPC_ID_INTC:
/* Third party (6500/7000) */
ctrl->slot_switch_type = 1; // Switch is present
ctrl->speed_capability = CTRL_SPEED_33MHz;
ctrl->speed_capability = PCI_SPEED_33MHz;
ctrl->push_button = 0; // No pushbutton
ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported
ctrl->defeature_PHP = 1; // PHP is supported
......@@ -885,7 +927,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* First 66 Mhz implementation */
ctrl->push_flag = 1;
ctrl->slot_switch_type = 1; // Switch is present
ctrl->speed_capability = CTRL_SPEED_66MHz;
ctrl->speed_capability = PCI_SPEED_66MHz;
ctrl->push_button = 1; // Pushbutton is present
ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported
ctrl->defeature_PHP = 1; // PHP is supported
......@@ -903,9 +945,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
case PCI_VENDOR_ID_INTEL:
/* Check for speed capability (0=33, 1=66) */
if (subsystem_deviceid & 0x0001) {
ctrl->speed_capability = CTRL_SPEED_66MHz;
ctrl->speed_capability = PCI_SPEED_66MHz;
} else {
ctrl->speed_capability = CTRL_SPEED_33MHz;
ctrl->speed_capability = PCI_SPEED_33MHz;
}
/* Check for push button */
......@@ -982,7 +1024,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
info("Initializing the PCI hot plug controller residing on PCI bus %d\n", pdev->bus->number);
dbg ("Hotplug controller capabilities:\n");
dbg (" speed_capability %s\n", ctrl->speed_capability == CTRL_SPEED_33MHz ? "33MHz" : "66Mhz");
dbg (" speed_capability %s\n", ctrl->speed_capability == PCI_SPEED_33MHz ? "33MHz" : "66Mhz");
dbg (" slot_switch_type %s\n", ctrl->slot_switch_type == 0 ? "no switch" : "switch present");
dbg (" defeature_PHP %s\n", ctrl->defeature_PHP == 0 ? "PHP not supported" : "PHP supported");
dbg (" alternate_base_address %s\n", ctrl->alternate_base_address == 0 ? "not supported" : "supported");
......
......@@ -1187,7 +1187,7 @@ static u32 board_replaced(struct pci_func * func, struct controller * ctrl)
//*********************************
rc = CARD_FUNCTIONING;
} else {
if (ctrl->speed == 1) {
if (ctrl->speed == PCI_SPEED_66MHz) {
// Wait for exclusive access to hardware
down(&ctrl->crit_sect);
......@@ -1385,7 +1385,7 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
dbg("%s: func->device, slot_offset, hp_slot = %d, %d ,%d\n",
__FUNCTION__, func->device, ctrl->slot_device_offset, hp_slot);
if (ctrl->speed == 1) {
if (ctrl->speed == PCI_SPEED_66MHz) {
// Wait for exclusive access to hardware
down(&ctrl->crit_sect);
......
......@@ -384,14 +384,15 @@ static int get_adapter_present (struct hotplug_slot *hotplug_slot, u8 * value)
debug ("get_adapter_present - Exit rc[%d] hpcrc[%x] value[%x]\n", rc, hpcrc, *value);
return rc;
}
/*
static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, u8 * value)
static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
{
int rc = -ENODEV;
struct slot *pslot;
u8 mode = 0;
debug ("get_max_bus_speed - Entry hotplug_slot[%lx] pvalue[%lx]\n", (ulong)hotplug_slot, (ulong) value);
debug ("%s - Entry hotplug_slot[%p] pvalue[%p]\n", __FUNCTION__,
hotplug_slot, value);
ibmphp_lock_operations ();
......@@ -413,25 +414,26 @@ static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, u8 * value)
*value = pslot->supported_speed + 0x01;
break;
default:
*/ /* Note (will need to change): there would be soon 256, 512 also */
/* rc = -ENODEV;
/* Note (will need to change): there would be soon 256, 512 also */
rc = -ENODEV;
}
}
} else
rc = -ENODEV;
ibmphp_unlock_operations ();
debug ("get_max_bus_speed - Exit rc[%d] value[%x]\n", rc, *value);
debug ("%s - Exit rc[%d] value[%x]\n", __FUNCTION__, rc, *value);
return rc;
}
static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, u8 * value)
static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
{
int rc = -ENODEV;
struct slot *pslot;
u8 mode = 0;
debug ("get_cur_bus_speed - Entry hotplug_slot[%lx] pvalue[%lx]\n", (ulong)hotplug_slot, (ulong) value);
debug ("%s - Entry hotplug_slot[%p] pvalue[%p]\n", __FUNCTION__,
hotplug_slot, value);
ibmphp_lock_operations ();
......@@ -458,8 +460,8 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, u8 * value)
*value += 0x01;
break;
default:
*/ /* Note of change: there would also be 256, 512 soon */
/* rc = -ENODEV;
/* Note of change: there would also be 256, 512 soon */
rc = -ENODEV;
}
}
}
......@@ -467,10 +469,10 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, u8 * value)
rc = -ENODEV;
ibmphp_unlock_operations ();
debug ("get_cur_bus_speed - Exit rc[%d] value[%x]\n", rc, *value);
debug ("%s - Exit rc[%d] value[%x]\n", __FUNCTION__, rc, *value);
return rc;
}
/*
static int get_max_adapter_speed_1 (struct hotplug_slot *hotplug_slot, u8 * value, u8 flag)
{
int rc = -ENODEV;
......@@ -1584,9 +1586,9 @@ struct hotplug_slot_ops ibmphp_hotplug_slot_ops = {
.get_attention_status = get_attention_status,
.get_latch_status = get_latch_status,
.get_adapter_status = get_adapter_present,
/* .get_max_bus_speed_status = get_max_bus_speed,
.get_max_adapter_speed_status = get_max_adapter_speed,
.get_cur_bus_speed_status = get_cur_bus_speed,
.get_max_bus_speed = get_max_bus_speed,
.get_cur_bus_speed = get_cur_bus_speed,
/* .get_max_adapter_speed = get_max_adapter_speed,
.get_bus_name_status = get_bus_name,
*/
};
......
......@@ -29,6 +29,22 @@
#define _PCI_HOTPLUG_H
/* These values come from the PCI Hotplug Spec */
enum pci_bus_speed {
PCI_SPEED_33MHz = 0x00,
PCI_SPEED_66MHz = 0x01,
PCI_SPEED_66MHz_PCIX = 0x02,
PCI_SPEED_100MHz_PCIX = 0x03,
PCI_SPEED_133MHz_PCIX = 0x04,
PCI_SPEED_66MHz_PCIX_266 = 0x09,
PCI_SPEED_100MHz_PCIX_266 = 0x0a,
PCI_SPEED_133MHz_PCIX_266 = 0x0b,
PCI_SPEED_66MHz_PCIX_533 = 0x11,
PCI_SPEED_100MHz_PCIX_533 = 0X12,
PCI_SPEED_133MHz_PCIX_533 = 0x13,
PCI_SPEED_UNKNOWN = 0xff,
};
struct hotplug_slot;
struct hotplug_slot_core;
......@@ -50,7 +66,13 @@ struct hotplug_slot_core;
* @get_latch_status: Called to get the current latch status of a slot.
* If this field is NULL, the value passed in the struct hotplug_slot_info
* will be used when this value is requested by a user.
* @get_adapter_present: Called to get see if an adapter is present in the slot or not.
* @get_adapter_status: Called to get see if an adapter is present in the slot or not.
* If this field is NULL, the value passed in the struct hotplug_slot_info
* will be used when this value is requested by a user.
* @get_max_bus_speed: Called to get the max bus speed for a slot.
* If this field is NULL, the value passed in the struct hotplug_slot_info
* will be used when this value is requested by a user.
* @get_cur_bus_speed: Called to get the current bus speed for a slot.
* If this field is NULL, the value passed in the struct hotplug_slot_info
* will be used when this value is requested by a user.
*
......@@ -69,6 +91,8 @@ struct hotplug_slot_ops {
int (*get_attention_status) (struct hotplug_slot *slot, u8 *value);
int (*get_latch_status) (struct hotplug_slot *slot, u8 *value);
int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value);
int (*get_max_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value);
int (*get_cur_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value);
};
/**
......@@ -85,6 +109,8 @@ struct hotplug_slot_info {
u8 attention_status;
u8 latch_status;
u8 adapter_status;
enum pci_bus_speed max_bus_speed;
enum pci_bus_speed cur_bus_speed;
};
/**
......
This diff is collapsed.
......@@ -371,7 +371,7 @@ static struct seq_operations proc_bus_pci_devices_op = {
show: show_device
};
static struct proc_dir_entry *proc_bus_pci_dir;
struct proc_dir_entry *proc_bus_pci_dir;
/* driverfs files */
static ssize_t pci_show_irq(struct device * dev, char * buf, size_t count, loff_t off)
......@@ -621,5 +621,6 @@ EXPORT_SYMBOL(pci_proc_attach_device);
EXPORT_SYMBOL(pci_proc_detach_device);
EXPORT_SYMBOL(pci_proc_attach_bus);
EXPORT_SYMBOL(pci_proc_detach_bus);
EXPORT_SYMBOL(proc_bus_pci_dir);
#endif
......@@ -610,8 +610,7 @@ NORET_TYPE void do_exit(long code)
if (tsk->pid == 1)
panic("Attempted to kill init!");
tsk->flags |= PF_EXITING;
if (timer_pending(&tsk->real_timer))
del_timer_sync(&tsk->real_timer);
del_timer_sync(&tsk->real_timer);
if (unlikely(preempt_count()))
printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
......
......@@ -53,6 +53,7 @@
#include <linux/root_dev.h>
#include <linux/percpu.h>
#include <linux/smp_lock.h>
#include <linux/dnotify.h>
#include <asm/checksum.h>
#if defined(CONFIG_PROC_FS)
......@@ -560,6 +561,7 @@ EXPORT_SYMBOL(buffer_insert_list);
EXPORT_SYMBOL(make_bad_inode);
EXPORT_SYMBOL(is_bad_inode);
EXPORT_SYMBOL(event);
EXPORT_SYMBOL(__inode_dir_notify);
#ifdef CONFIG_UID16
EXPORT_SYMBOL(overflowuid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment