public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bukie Mabayoje <bukiemab@gte.net>
To: Corey Minyard <minyard@acm.org>
Cc: Andrew Morton <akpm@osdl.org>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Update to IPMI driver to support old DMI spec
Date: Wed, 09 Feb 2005 13:36:43 -0800	[thread overview]
Message-ID: <420A826B.A4360D24@gte.net> (raw)
In-Reply-To: 420A474B.2030608@acm.org



Corey Minyard wrote:

> BTW, I'm also working with the person who had the trouble with the I2C
> non-blocking driver updates, but we haven't figured it out yet.
> Hopefully soon.  (Though that has nothing to do with this patch.)
>
> Thanks,
>
> -Corey
>
>                                                   -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> The 1999 version of the DMI spec had a different configuration
> than the newer versions for the IPMI configuration information.

Are you referring to the System Management BIOS Reference Specification  version 2.3.1 16 March 1999?

>
> This patch handles the differences between the two.
>
> Signed-off-by: Corey Minyard <minyard@acm.org>
>
> Index: linux-2.6.11-rc3/drivers/char/ipmi/ipmi_si_intf.c
> ===================================================================
> --- linux-2.6.11-rc3.orig/drivers/char/ipmi/ipmi_si_intf.c
> +++ linux-2.6.11-rc3/drivers/char/ipmi/ipmi_si_intf.c
> @@ -1578,46 +1578,53 @@
>         u8              *data = (u8 *)dm;
>         unsigned long   base_addr;
>         u8              reg_spacing;
> +       u8              len = dm->length;
>         dmi_ipmi_data_t *ipmi_data = dmi_data+intf_num;
>
>         ipmi_data->type = data[4];
>
>         memcpy(&base_addr, data+8, sizeof(unsigned long));
> -       if (base_addr & 1) {
> -               /* I/O */
> -               base_addr &= 0xFFFE;
> +       if (len >= 0x11) {
> +               if (base_addr & 1) {
> +                       /* I/O */
> +                       base_addr &= 0xFFFE;
> +                       ipmi_data->addr_space = IPMI_IO_ADDR_SPACE;
> +               }
> +               else {
> +                       /* Memory */
> +                       ipmi_data->addr_space = IPMI_MEM_ADDR_SPACE;
> +               }
> +               /* If bit 4 of byte 0x10 is set, then the lsb for the address
> +                  is odd. */
> +               ipmi_data->base_addr = base_addr | ((data[0x10] & 0x10) >> 4);
> +
> +               ipmi_data->irq = data[0x11];
> +
> +               /* The top two bits of byte 0x10 hold the register spacing. */
> +               reg_spacing = (data[0x10] & 0xC0) >> 6;
> +               switch(reg_spacing){
> +               case 0x00: /* Byte boundaries */
> +                   ipmi_data->offset = 1;
> +                   break;
> +               case 0x01: /* 32-bit boundaries */
> +                   ipmi_data->offset = 4;
> +                   break;
> +               case 0x02: /* 16-byte boundaries */
> +                   ipmi_data->offset = 16;
> +                   break;
> +               default:
> +                   /* Some other interface, just ignore it. */
> +                   return -EIO;
> +               }
> +       } else {
> +               /* Old DMI spec. */
> +               ipmi_data->base_addr = base_addr;
>                 ipmi_data->addr_space = IPMI_IO_ADDR_SPACE;
> -       }
> -       else {
> -               /* Memory */
> -               ipmi_data->addr_space = IPMI_MEM_ADDR_SPACE;
> -       }
> -
> -       /* The top two bits of byte 0x10 hold the register spacing. */
> -       reg_spacing = (data[0x10] & 0xC0) >> 6;
> -       switch(reg_spacing){
> -       case 0x00: /* Byte boundaries */
>                 ipmi_data->offset = 1;
> -               break;
> -       case 0x01: /* 32-bit boundaries */
> -               ipmi_data->offset = 4;
> -               break;
> -       case 0x02: /* 16-byte boundaries */
> -               ipmi_data->offset = 16;
> -               break;
> -       default:
> -               /* Some other interface, just ignore it. */
> -               return -EIO;
>         }
>
>         ipmi_data->slave_addr = data[6];
>
> -       /* If bit 4 of byte 0x10 is set, then the lsb for the address
> -          is odd. */
> -       ipmi_data->base_addr = base_addr | ((data[0x10] & 0x10) >> 4);
> -
> -       ipmi_data->irq = data[0x11];
> -
>         if (is_new_interface(-1, ipmi_data->addr_space,ipmi_data->base_addr)) {
>                 dmi_data_entries++;
>                 return 0;

  reply	other threads:[~2005-02-09 21:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-09 17:24 [PATCH] Update to IPMI driver to support old DMI spec Corey Minyard
2005-02-09 21:36 ` Bukie Mabayoje [this message]
2005-02-09 21:39   ` Corey Minyard

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=420A826B.A4360D24@gte.net \
    --to=bukiemab@gte.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@acm.org \
    /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