Commit dd4f25fb authored by Irene Zubarev's avatar Irene Zubarev Committed by Greg Kroah-Hartman

[PATCH] IBM PCI Hotplug: small patch

This is a small patch on top of what you sent out to the kernel
already.  I basically uncommented out another place, where we call
pci_hp_change_info and changed to the new method.  And also, when I sent
you those (polling, isa, pci...) patches sometime back, I made a mistake
when I was translating the code from the way RPM is to the way we want in
the kernel (since in RPM we cannot have option to compile kernel).
parent cd509844
...@@ -686,9 +686,10 @@ static int validate (struct slot *slot_cur, int opn) ...@@ -686,9 +686,10 @@ static int validate (struct slot *slot_cur, int opn)
int ibmphp_update_slot_info (struct slot *slot_cur) int ibmphp_update_slot_info (struct slot *slot_cur)
{ {
struct hotplug_slot_info *info; struct hotplug_slot_info *info;
char buffer[10]; char buffer[30];
int rc; int rc;
// u8 bus_speed; u8 bus_speed;
u8 mode;
info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
if (!info) { if (!info) {
...@@ -696,7 +697,7 @@ int ibmphp_update_slot_info (struct slot *slot_cur) ...@@ -696,7 +697,7 @@ int ibmphp_update_slot_info (struct slot *slot_cur)
return -ENOMEM; return -ENOMEM;
} }
snprintf (buffer, 10, "%d", slot_cur->number); strncpy (buffer, slot_cur->hotplug_slot->name, 30);
info->power_status = SLOT_PWRGD (slot_cur->status); info->power_status = SLOT_PWRGD (slot_cur->status);
info->attention_status = SLOT_ATTN (slot_cur->status, slot_cur->ext_status); info->attention_status = SLOT_ATTN (slot_cur->status, slot_cur->ext_status);
info->latch_status = SLOT_LATCH (slot_cur->status); info->latch_status = SLOT_LATCH (slot_cur->status);
...@@ -707,21 +708,33 @@ int ibmphp_update_slot_info (struct slot *slot_cur) ...@@ -707,21 +708,33 @@ int ibmphp_update_slot_info (struct slot *slot_cur)
info->adapter_status = 1; info->adapter_status = 1;
// get_max_adapter_speed_1 (slot_cur->hotplug_slot, &info->max_adapter_speed_status, 0); // get_max_adapter_speed_1 (slot_cur->hotplug_slot, &info->max_adapter_speed_status, 0);
} }
/* !!!!!!!!!TO DO: THIS NEEDS TO CHANGE!!!!!!!!!!!!! */
/* bus_speed = slot_cur->bus_on->current_speed; bus_speed = slot_cur->bus_on->current_speed;
bus_speed &= 0x0f; mode = slot_cur->bus_on->current_bus_mode;
if (slot_cur->bus_on->current_bus_mode == BUS_MODE_PCIX) switch (bus_speed) {
bus_speed |= 0x80; case BUS_SPEED_33:
else if (slot_cur->bus_on->current_bus_mode == BUS_MODE_PCI) break;
bus_speed |= 0x40; case BUS_SPEED_66:
else if (mode == BUS_MODE_PCIX)
bus_speed |= 0x20; bus_speed += 0x01;
else if (mode == BUS_MODE_PCI)
;
else
bus_speed = PCI_SPEED_UNKNOWN;
break;
case BUS_SPEED_100:
case BUS_SPEED_133:
bus_speed += 0x01;
break;
default:
bus_speed = PCI_SPEED_UNKNOWN;
}
info->cur_bus_speed_status = bus_speed; info->cur_bus_speed_status = bus_speed;
info->max_bus_speed_status = slot_cur->hotplug_slot->info->max_bus_speed_status; info->max_bus_speed_status = slot_cur->hotplug_slot->info->max_bus_speed_status;
// To do: bus_names // To do: bus_names
*/
rc = pci_hp_change_slot_info (buffer, info); rc = pci_hp_change_slot_info (buffer, info);
kfree (info); kfree (info);
return rc; return rc;
...@@ -989,7 +1002,7 @@ static u8 bus_structure_fixup (u8 busno) ...@@ -989,7 +1002,7 @@ static u8 bus_structure_fixup (u8 busno)
struct pci_dev *dev; struct pci_dev *dev;
u16 l; u16 l;
if (!find_bus (busno) || !(ibmphp_find_same_bus_num (busno))) if (find_bus (busno) || !(ibmphp_find_same_bus_num (busno)))
return 1; return 1;
bus = kmalloc (sizeof (*bus), GFP_KERNEL); bus = kmalloc (sizeof (*bus), GFP_KERNEL);
......
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