From: Greg KH <greg@kroah.com>
To: marcelo@conectiva.com.br
Cc: linux-kernel@vger.kernel.org, pcihpd-discuss@lists.sourceforge.net
Subject: Re: [PATCH] PCI Hotplug fixes for 2.4.20-pre10
Date: Thu, 10 Oct 2002 14:46:25 -0700 [thread overview]
Message-ID: <20021010214625.GD27523@kroah.com> (raw)
In-Reply-To: <20021010214549.GC27523@kroah.com>
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.739 -> 1.740
# drivers/hotplug/ibmphp_core.c 1.7 -> 1.8
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/10 zubarev@us.ibm.com 1.740
# [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).
# --------------------------------------------
#
diff -Nru a/drivers/hotplug/ibmphp_core.c b/drivers/hotplug/ibmphp_core.c
--- a/drivers/hotplug/ibmphp_core.c Thu Oct 10 14:44:40 2002
+++ b/drivers/hotplug/ibmphp_core.c Thu Oct 10 14:44:40 2002
@@ -686,9 +686,10 @@
int ibmphp_update_slot_info (struct slot *slot_cur)
{
struct hotplug_slot_info *info;
- char buffer[10];
+ char buffer[30];
int rc;
-// u8 bus_speed;
+ u8 bus_speed;
+ u8 mode;
info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL);
if (!info) {
@@ -696,7 +697,7 @@
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->attention_status = SLOT_ATTN (slot_cur->status, slot_cur->ext_status);
info->latch_status = SLOT_LATCH (slot_cur->status);
@@ -707,21 +708,33 @@
info->adapter_status = 1;
// 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 &= 0x0f;
-
- if (slot_cur->bus_on->current_bus_mode == BUS_MODE_PCIX)
- bus_speed |= 0x80;
- else if (slot_cur->bus_on->current_bus_mode == BUS_MODE_PCI)
- bus_speed |= 0x40;
- else
- bus_speed |= 0x20;
+
+ bus_speed = slot_cur->bus_on->current_speed;
+ mode = slot_cur->bus_on->current_bus_mode;
+
+ switch (bus_speed) {
+ case BUS_SPEED_33:
+ break;
+ case BUS_SPEED_66:
+ if (mode == BUS_MODE_PCIX)
+ 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->max_bus_speed_status = slot_cur->hotplug_slot->info->max_bus_speed_status;
// To do: bus_names
-*/
+
rc = pci_hp_change_slot_info (buffer, info);
kfree (info);
return rc;
@@ -1001,7 +1014,7 @@
struct pci_dev dev_t;
u16 l;
- if (!find_bus (busno) || !(ibmphp_find_same_bus_num (busno)))
+ if (find_bus (busno) || !(ibmphp_find_same_bus_num (busno)))
return 1;
bus_t.number = busno;
bus_t.ops = ibmphp_pci_root_ops;
next prev parent reply other threads:[~2002-10-10 21:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-10 21:44 [BK PATCH] PCI Hotplug fixes for 2.4.20-pre10 Greg KH
2002-10-10 21:45 ` [PATCH] " Greg KH
2002-10-10 21:45 ` Greg KH
2002-10-10 21:46 ` Greg KH [this message]
2002-10-10 21:48 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021010214625.GD27523@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=pcihpd-discuss@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox