linux/drivers/firmware/iscsi_ibft.c
<<
>>
Prefs
   1/*
   2 *  Copyright 2007-2010 Red Hat, Inc.
   3 *  by Peter Jones <pjones@redhat.com>
   4 *  Copyright 2008 IBM, Inc.
   5 *  by Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
   6 *  Copyright 2008
   7 *  by Konrad Rzeszutek <ketuzsezr@darnok.org>
   8 *
   9 * This code exposes the iSCSI Boot Format Table to userland via sysfs.
  10 *
  11 * This program is free software; you can redistribute it and/or modify
  12 * it under the terms of the GNU General Public License v2.0 as published by
  13 * the Free Software Foundation
  14 *
  15 * This program is distributed in the hope that it will be useful,
  16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18 * GNU General Public License for more details.
  19 *
  20 * Changelog:
  21 *
  22 *  06 Jan 2010 - Peter Jones <pjones@redhat.com>
  23 *    New changelog entries are in the git log from now on.  Not here.
  24 *
  25 *  14 Mar 2008 - Konrad Rzeszutek <ketuzsezr@darnok.org>
  26 *    Updated comments and copyrights. (v0.4.9)
  27 *
  28 *  11 Feb 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  29 *    Converted to using ibft_addr. (v0.4.8)
  30 *
  31 *   8 Feb 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  32 *    Combined two functions in one: reserve_ibft_region. (v0.4.7)
  33 *
  34 *  30 Jan 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  35 *   Added logic to handle IPv6 addresses. (v0.4.6)
  36 *
  37 *  25 Jan 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  38 *   Added logic to handle badly not-to-spec iBFT. (v0.4.5)
  39 *
  40 *   4 Jan 2008 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  41 *   Added __init to function declarations. (v0.4.4)
  42 *
  43 *  21 Dec 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  44 *   Updated kobject registration, combined unregister functions in one
  45 *   and code and style cleanup. (v0.4.3)
  46 *
  47 *   5 Dec 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  48 *   Added end-markers to enums and re-organized kobject registration. (v0.4.2)
  49 *
  50 *   4 Dec 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  51 *   Created 'device' sysfs link to the NIC and style cleanup. (v0.4.1)
  52 *
  53 *  28 Nov 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  54 *   Added sysfs-ibft documentation, moved 'find_ibft' function to
  55 *   in its own file and added text attributes for every struct field.  (v0.4)
  56 *
  57 *  21 Nov 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  58 *   Added text attributes emulating OpenFirmware /proc/device-tree naming.
  59 *   Removed binary /sysfs interface (v0.3)
  60 *
  61 *  29 Aug 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  62 *   Added functionality in setup.c to reserve iBFT region. (v0.2)
  63 *
  64 *  27 Aug 2007 - Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
  65 *   First version exposing iBFT data via a binary /sysfs. (v0.1)
  66 *
  67 */
  68
  69
  70#include <linux/blkdev.h>
  71#include <linux/capability.h>
  72#include <linux/ctype.h>
  73#include <linux/device.h>
  74#include <linux/err.h>
  75#include <linux/init.h>
  76#include <linux/iscsi_ibft.h>
  77#include <linux/limits.h>
  78#include <linux/module.h>
  79#include <linux/pci.h>
  80#include <linux/slab.h>
  81#include <linux/stat.h>
  82#include <linux/string.h>
  83#include <linux/types.h>
  84#include <linux/acpi.h>
  85#include <linux/iscsi_boot_sysfs.h>
  86
  87#define IBFT_ISCSI_VERSION "0.5.0"
  88#define IBFT_ISCSI_DATE "2010-Feb-25"
  89
  90MODULE_AUTHOR("Peter Jones <pjones@redhat.com> and "
  91              "Konrad Rzeszutek <ketuzsezr@darnok.org>");
  92MODULE_DESCRIPTION("sysfs interface to BIOS iBFT information");
  93MODULE_LICENSE("GPL");
  94MODULE_VERSION(IBFT_ISCSI_VERSION);
  95
  96struct ibft_hdr {
  97        u8 id;
  98        u8 version;
  99        u16 length;
 100        u8 index;
 101        u8 flags;
 102} __attribute__((__packed__));
 103
 104struct ibft_control {
 105        struct ibft_hdr hdr;
 106        u16 extensions;
 107        u16 initiator_off;
 108        u16 nic0_off;
 109        u16 tgt0_off;
 110        u16 nic1_off;
 111        u16 tgt1_off;
 112} __attribute__((__packed__));
 113
 114struct ibft_initiator {
 115        struct ibft_hdr hdr;
 116        char isns_server[16];
 117        char slp_server[16];
 118        char pri_radius_server[16];
 119        char sec_radius_server[16];
 120        u16 initiator_name_len;
 121        u16 initiator_name_off;
 122} __attribute__((__packed__));
 123
 124struct ibft_nic {
 125        struct ibft_hdr hdr;
 126        char ip_addr[16];
 127        u8 subnet_mask_prefix;
 128        u8 origin;
 129        char gateway[16];
 130        char primary_dns[16];
 131        char secondary_dns[16];
 132        char dhcp[16];
 133        u16 vlan;
 134        char mac[6];
 135        u16 pci_bdf;
 136        u16 hostname_len;
 137        u16 hostname_off;
 138} __attribute__((__packed__));
 139
 140struct ibft_tgt {
 141        struct ibft_hdr hdr;
 142        char ip_addr[16];
 143        u16 port;
 144        char lun[8];
 145        u8 chap_type;
 146        u8 nic_assoc;
 147        u16 tgt_name_len;
 148        u16 tgt_name_off;
 149        u16 chap_name_len;
 150        u16 chap_name_off;
 151        u16 chap_secret_len;
 152        u16 chap_secret_off;
 153        u16 rev_chap_name_len;
 154        u16 rev_chap_name_off;
 155        u16 rev_chap_secret_len;
 156        u16 rev_chap_secret_off;
 157} __attribute__((__packed__));
 158
 159/*
 160 * The kobject different types and its names.
 161 *
 162*/
 163enum ibft_id {
 164        id_reserved = 0, /* We don't support. */
 165        id_control = 1, /* Should show up only once and is not exported. */
 166        id_initiator = 2,
 167        id_nic = 3,
 168        id_target = 4,
 169        id_extensions = 5, /* We don't support. */
 170        id_end_marker,
 171};
 172
 173/*
 174 * The kobject and attribute structures.
 175 */
 176
 177struct ibft_kobject {
 178        struct acpi_table_ibft *header;
 179        union {
 180                struct ibft_initiator *initiator;
 181                struct ibft_nic *nic;
 182                struct ibft_tgt *tgt;
 183                struct ibft_hdr *hdr;
 184        };
 185};
 186
 187static struct iscsi_boot_kset *boot_kset;
 188
 189static const char nulls[16];
 190
 191/*
 192 * Helper functions to parse data properly.
 193 */
 194static ssize_t sprintf_ipaddr(char *buf, u8 *ip)
 195{
 196        char *str = buf;
 197
 198        if (ip[0] == 0 && ip[1] == 0 && ip[2] == 0 && ip[3] == 0 &&
 199            ip[4] == 0 && ip[5] == 0 && ip[6] == 0 && ip[7] == 0 &&
 200            ip[8] == 0 && ip[9] == 0 && ip[10] == 0xff && ip[11] == 0xff) {
 201                /*
 202                 * IPV4
 203                 */
 204                str += sprintf(buf, "%pI4", ip + 12);
 205        } else {
 206                /*
 207                 * IPv6
 208                 */
 209                str += sprintf(str, "%pI6", ip);
 210        }
 211        str += sprintf(str, "\n");
 212        return str - buf;
 213}
 214
 215static ssize_t sprintf_string(char *str, int len, char *buf)
 216{
 217        return sprintf(str, "%.*s\n", len, buf);
 218}
 219
 220/*
 221 * Helper function to verify the IBFT header.
 222 */
 223static int ibft_verify_hdr(char *t, struct ibft_hdr *hdr, int id, int length)
 224{
 225        if (hdr->id != id) {
 226                printk(KERN_ERR "iBFT error: We expected the %s " \
 227                                "field header.id to have %d but " \
 228                                "found %d instead!\n", t, id, hdr->id);
 229                return -ENODEV;
 230        }
 231        if (hdr->length != length) {
 232                printk(KERN_ERR "iBFT error: We expected the %s " \
 233                                "field header.length to have %d but " \
 234                                "found %d instead!\n", t, length, hdr->length);
 235                return -ENODEV;
 236        }
 237
 238        return 0;
 239}
 240
 241/*
 242 *  Routines for parsing the iBFT data to be human readable.
 243 */
 244static ssize_t ibft_attr_show_initiator(void *data, int type, char *buf)
 245{
 246        struct ibft_kobject *entry = data;
 247        struct ibft_initiator *initiator = entry->initiator;
 248        void *ibft_loc = entry->header;
 249        char *str = buf;
 250
 251        if (!initiator)
 252                return 0;
 253
 254        switch (type) {
 255        case ISCSI_BOOT_INI_INDEX:
 256                str += sprintf(str, "%d\n", initiator->hdr.index);
 257                break;
 258        case ISCSI_BOOT_INI_FLAGS:
 259                str += sprintf(str, "%d\n", initiator->hdr.flags);
 260                break;
 261        case ISCSI_BOOT_INI_ISNS_SERVER:
 262                str += sprintf_ipaddr(str, initiator->isns_server);
 263                break;
 264        case ISCSI_BOOT_INI_SLP_SERVER:
 265                str += sprintf_ipaddr(str, initiator->slp_server);
 266                break;
 267        case ISCSI_BOOT_INI_PRI_RADIUS_SERVER:
 268                str += sprintf_ipaddr(str, initiator->pri_radius_server);
 269                break;
 270        case ISCSI_BOOT_INI_SEC_RADIUS_SERVER:
 271                str += sprintf_ipaddr(str, initiator->sec_radius_server);
 272                break;
 273        case ISCSI_BOOT_INI_INITIATOR_NAME:
 274                str += sprintf_string(str, initiator->initiator_name_len,
 275                                      (char *)ibft_loc +
 276                                      initiator->initiator_name_off);
 277                break;
 278        default:
 279                break;
 280        }
 281
 282        return str - buf;
 283}
 284
 285static ssize_t ibft_attr_show_nic(void *data, int type, char *buf)
 286{
 287        struct ibft_kobject *entry = data;
 288        struct ibft_nic *nic = entry->nic;
 289        void *ibft_loc = entry->header;
 290        char *str = buf;
 291        __be32 val;
 292
 293        if (!nic)
 294                return 0;
 295
 296        switch (type) {
 297        case ISCSI_BOOT_ETH_INDEX:
 298                str += sprintf(str, "%d\n", nic->hdr.index);
 299                break;
 300        case ISCSI_BOOT_ETH_FLAGS:
 301                str += sprintf(str, "%d\n", nic->hdr.flags);
 302                break;
 303        case ISCSI_BOOT_ETH_IP_ADDR:
 304                str += sprintf_ipaddr(str, nic->ip_addr);
 305                break;
 306        case ISCSI_BOOT_ETH_SUBNET_MASK:
 307                val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
 308                str += sprintf(str, "%pI4", &val);
 309                break;
 310        case ISCSI_BOOT_ETH_ORIGIN:
 311                str += sprintf(str, "%d\n", nic->origin);
 312                break;
 313        case ISCSI_BOOT_ETH_GATEWAY:
 314                str += sprintf_ipaddr(str, nic->gateway);
 315                break;
 316        case ISCSI_BOOT_ETH_PRIMARY_DNS:
 317                str += sprintf_ipaddr(str, nic->primary_dns);
 318                break;
 319        case ISCSI_BOOT_ETH_SECONDARY_DNS:
 320                str += sprintf_ipaddr(str, nic->secondary_dns);
 321                break;
 322        case ISCSI_BOOT_ETH_DHCP:
 323                str += sprintf_ipaddr(str, nic->dhcp);
 324                break;
 325        case ISCSI_BOOT_ETH_VLAN:
 326                str += sprintf(str, "%d\n", nic->vlan);
 327                break;
 328        case ISCSI_BOOT_ETH_MAC:
 329                str += sprintf(str, "%pM\n", nic->mac);
 330                break;
 331        case ISCSI_BOOT_ETH_HOSTNAME:
 332                str += sprintf_string(str, nic->hostname_len,
 333                                      (char *)ibft_loc + nic->hostname_off);
 334                break;
 335        default:
 336                break;
 337        }
 338
 339        return str - buf;
 340};
 341
 342static ssize_t ibft_attr_show_target(void *data, int type, char *buf)
 343{
 344        struct ibft_kobject *entry = data;
 345        struct ibft_tgt *tgt = entry->tgt;
 346        void *ibft_loc = entry->header;
 347        char *str = buf;
 348        int i;
 349
 350        if (!tgt)
 351                return 0;
 352
 353        switch (type) {
 354        case ISCSI_BOOT_TGT_INDEX:
 355                str += sprintf(str, "%d\n", tgt->hdr.index);
 356                break;
 357        case ISCSI_BOOT_TGT_FLAGS:
 358                str += sprintf(str, "%d\n", tgt->hdr.flags);
 359                break;
 360        case ISCSI_BOOT_TGT_IP_ADDR:
 361                str += sprintf_ipaddr(str, tgt->ip_addr);
 362                break;
 363        case ISCSI_BOOT_TGT_PORT:
 364                str += sprintf(str, "%d\n", tgt->port);
 365                break;
 366        case ISCSI_BOOT_TGT_LUN:
 367                for (i = 0; i < 8; i++)
 368                        str += sprintf(str, "%x", (u8)tgt->lun[i]);
 369                str += sprintf(str, "\n");
 370                break;
 371        case ISCSI_BOOT_TGT_NIC_ASSOC:
 372                str += sprintf(str, "%d\n", tgt->nic_assoc);
 373                break;
 374        case ISCSI_BOOT_TGT_CHAP_TYPE:
 375                str += sprintf(str, "%d\n", tgt->chap_type);
 376                break;
 377        case ISCSI_BOOT_TGT_NAME:
 378                str += sprintf_string(str, tgt->tgt_name_len,
 379                                      (char *)ibft_loc + tgt->tgt_name_off);
 380                break;
 381        case ISCSI_BOOT_TGT_CHAP_NAME:
 382                str += sprintf_string(str, tgt->chap_name_len,
 383                                      (char *)ibft_loc + tgt->chap_name_off);
 384                break;
 385        case ISCSI_BOOT_TGT_CHAP_SECRET:
 386                str += sprintf_string(str, tgt->chap_secret_len,
 387                                      (char *)ibft_loc + tgt->chap_secret_off);
 388                break;
 389        case ISCSI_BOOT_TGT_REV_CHAP_NAME:
 390                str += sprintf_string(str, tgt->rev_chap_name_len,
 391                                      (char *)ibft_loc +
 392                                      tgt->rev_chap_name_off);
 393                break;
 394        case ISCSI_BOOT_TGT_REV_CHAP_SECRET:
 395                str += sprintf_string(str, tgt->rev_chap_secret_len,
 396                                      (char *)ibft_loc +
 397                                      tgt->rev_chap_secret_off);
 398                break;
 399        default:
 400                break;
 401        }
 402
 403        return str - buf;
 404}
 405
 406static int __init ibft_check_device(void)
 407{
 408        int len;
 409        u8 *pos;
 410        u8 csum = 0;
 411
 412        len = ibft_addr->header.length;
 413
 414        /* Sanity checking of iBFT. */
 415        if (ibft_addr->header.revision != 1) {
 416                printk(KERN_ERR "iBFT module supports only revision 1, " \
 417                                "while this is %d.\n",
 418                                ibft_addr->header.revision);
 419                return -ENOENT;
 420        }
 421        for (pos = (u8 *)ibft_addr; pos < (u8 *)ibft_addr + len; pos++)
 422                csum += *pos;
 413
 415            revision != 1) {
 395                printk(KERN_ERR "%d\n"          pos;
 419                return -ENOENT;
 337        }
 338
csum = 0;
 337        }
 411
 414       nity checking of iBFT. */
 414      * Helper rout#L3rs toclass= tocdeterm#L3me="the code="strvalidnity checking of iBFT. */
 414      * in"the proper pan ce="L34ure.nity checking of iBFT. */
 414      *anity checking of iBFT. */
pos__init <=nicf   iattr_show_target(void *data, int pos++)
 407{
 288        struct ibft_kobject *entry = data;
 288        struct ibft_nic *nic = entry->nic;
 410_r/a>->csum = 0;
 341
 353        switch (type) {
 303        case ISCSI_BOOT_ETH_INDEX:
 394        case ISCSI_BOOT_ETH_FLAGS:
 395      r/a>-> 395      S_IRUGOa>->nic;
 376                break;
 297        case ISCSI_BOOT_ETH_IP_ADDR:
 415  memcma>->p>str, nic->ull/a> += *ull/ddr"ste=ssof" class="sref">p>str, nic->pos++)
 379 395      r/a>-> 395      S_IRUGOa>->nic;
 400                break;
 331        case ISCSI_BOOT_ETH_SUBNET_MASK:
 415  ;< (32-nic-> 383 395      r/a>-> 395      S_IRUGOa>->nic;
 384                break;
 325        case ISCSI_BOOT_ETH_ORIGIN:
 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 328        case ISCSI_BOOT_ETH_GATEWAY:
 415  memcma>->p>str, nic->ull/a> += *ull/ddr"ste=ssof" class="sref">p>str, nic->pos++)
 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 316        case ISCSI_BOOT_ETH_PRIMARY_DNS:
 415  memcma>->p>str, nic->ull/a> += *ull/ddr"sBOOT_ETH_PRIMARY_DNS:
p>str, nic->pos++)
 395      r/a>-> 395      S_IRUGOa>->nic;
 376                break;
 297        case ISCSI_BOOT_ETH_SECONDARY_DNS:
 415  memcma>->p>str, nic->ull/a> += *ull/ddr"sBOOT_ETH_PRIMARY_DNS:
p>str, nic->pos++)
 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 316        case ISCSI_BOOT_ETH_DHCP:
 415  memcma>->p>str, nic->ull/a> += *ull/ddr"ste=ssof" class="sref">p>str, nic->pos++)
 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 366        case ISCSI_BOOT_ETH_VLAN:
 377        case ISCSI_BOOT_ETH_MAC:
 378      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 360        case ISCSI_BOOT_ETH_HOSTNAME:
 415  ;< (32-nic->:
 378      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 399        default:
 327                break;
 337        }
 337        }
 403     r/a>->                break;
 337        }
 337        }
pos_tatic int __init iattr_show_target(void *data, int pos++)
type) {
 288        struct ibft_kobject *entry = data;
 345        struct ibft_tgt *tgt = entry->tgt;
pos_r/a>->csum = 0;
csum = 0;
 353        switch (type) {
 328        case ISCSI_BOOT_TGT_INDEX:
 389        case ISCSI_BOOT_TGT_FLAGS:
 360        case ISCSI_BOOT_TGT_IP_ADDR:
 381        case ISCSI_BOOT_TGT_PORT:
 316        case ISCSI_BOOT_TGT_LUN:
 371        case ISCSI_BOOT_TGT_NIC_ASSOC:
 374        case ISCSI_BOOT_TGT_CHAP_TYPE:
 395      r/a>-> 395      S_IRUGOa>->nic;
 366        case ISCSI_BOOT_TGT_NAME:
 415  >str, tgt->pos++)
 368              r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 360        case ISCSI_BOOT_TGT_CHAP_NAME:
 381        case ISCSI_BOOT_TGT_CHAP_SECRET:
 415  >str, tgt->pos++)
 383 395      r/a>-> 395      S_IRUGOa>->nic;
 384                break;
 385        case ISCSI_BOOT_TGT_REV_CHAP_NAME:
 366        case ISCSI_BOOT_TGT_REV_CHAP_SECRET:
 415  >str, tgt->pos++)
 418 395      r/a>-> 395      S_IRUGOa>->nic;
 384                break;
 399        default:
 327                break;
 337        }
 413
 403     r/a>->                break;
 337        }
csum = 0;
pos_tatic int __init iattr_show_target(void *data, int pos++)
type) {
 288        struct ibft_kobject *entry = data;
 288        ste=__iator href="+code=ibft_koe=__iatorclass="sref">ibft_kobtic int tgt = entre=__iator href="+code=ibf=__iatorclasta" class="sref">data;
pos_r/a>->csum = 0;
 402
 353        switch (type) {
 374        case :
 385        case :
 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 328        case IRVEode=ISCSI_BOOT_TGT_IP_ADDR"INIreSNS">IRVEo_BOOT_TGT_REV_CHAP_SECRET:
 415  memcma>->ptic int entresns_serv>-> 415  ;ull/a> += *ull/ddr"sBOOT_ETH_PRIMARY_DNS:
ptic int entresns_serv>->pos++)
 391 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 303        case IRVEode=ISCSI_BOOT_TGT_IP_ADDR"INIrSLP">IRVEo_BOOT_TGT_REV_CHAP_SECRET:
 415  memcma>->ptic int entrslp_serv>-> 415  ;ull/a> += *ull/ddr"sBOOT_ETH_PRIMARY_DNS:
ptic int entrslp_serv>->pos++)
 391 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 328        case IRVEode=ISCSI_BOOT_TGT_IP_ADDR"INIrPRI_RADIUS">IRVEo_BOOT_TGT_REV_CHAP_SECRET:
 415  memcma>->ptic int entrpri_radius_serv>-> 415  ;ull/a> += *ull/ddr"sBOOT_ETH_PRIMARY_DNS:
ptic int entrpri_radius_serv>->pos++)
 391 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 303        case IRVEode=ISCSI_BOOT_TGT_IP_ADDR"INIrSEC_RADIUS">IRVEo_BOOT_TGT_REV_CHAP_SECRET:
 415  memcma>->ptic int entrsec_radius_serv>-> 415  ;ull/a> += *ull/ddr"sBOOT_ETH_PRIMARY_DNS:
ptic int entrsec_radius_serv>->pos++)
 391 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 328        case :
 415  tic int entre=__iatora;pos++)
 395      r/a>-> 395      S_IRUGOa>->nic;
 327                break;
 399        default:
 327                break;
 337        }
 405
 403     r/a>->                break;
 337        }
 338
ia"> 288        struct_rele="L href="+code=ibft_kobjec_rele="Lintk"f">iattr_show_target(void *pos++)
type) {
posp/a>(void * 337        }
 413
 414       nity checking of iBFT. */
 414      * Helper functodule="Lft_koregisterobject" s.nity checking of iBFT. */
 414      *anity checking of iBFT. */
 406static int __init< 32tetruct  288     acpi_tablef="dr href="+code=ibacpi_tablef="drclass="sref">ibft_kobr-> 288        sth *)ibft_kobh *)pos++)
type) {
 288       hrefbookobjec>ibft_kobbookobjec>                break;
 288        struct ibft_kobft_kobjec href="+code=ibft_kobjecclassic> 395      NULL> 288        struct ibft_nic * 288        struct  288     pci_dev>ibftpci_dev>                break;
 406sr/a>->csum = 0;
 405
ibft_kobft_kobjec href="+code=ibft_kobjecclassic> 395      kzallo/a>->ibft_kobft_kobjec href="+code=ibft_kobjecclas)ta415"> 415  GFP_e=KEEL>ibft_kobft_kobjec href="+code=ibft_kobjecclas)/a>                break;
 419                rMEM href="+code=ib  rMEMic"                 break;
 410ibft_addr->                break;
posibft_addr *)                break;
 402
 353      r *)entred href="+code=ibfdclas)e" class="sref">type) {
 374   idte=__iator href="+code=ibfdoe=__iatorclas"> 399        default:
 395      r/a>-> 395      ft_ko   ifyth *)KERN_ERR "%d\n"r *):
 391ibft_kobft_kobjec href="+code=ibft_kobjecclasy" class="sref">entre=__iator href="+code=ibf=__iatorclas)s                break;
 415  r/a>->                break;
 327                break;
ibft_kobbookobjec>pbookobsea href="+code=ibbookobseaclasuot;%d\n"r *)entrende="+code=subnet_mende=classBOOT_ETH_PRIMARY_DNS:
 391ibft_kobft_kobjec href="+code=ibft_kobjecclassBOOT_ETH_PRIMARY_DNS:
 391ibft_kobft_koattr_showte=__iator href="+code=ibft_koattr_showte=__iatorclassBOOT_ETH_PRIMARY_DNS:
 383ibft_kobft_ko  383ibft_kobft_koruct_rele="L href="+code=ibft_kobjec_rele="Lintks                break;
ibft_kobbookobjec>type) {
 391 395      r/a>->                rMEM href="+code=ib  rMEMic"                 break;
 395      freLf="dr_jec>                break;
 337        }
 327                break;
 360   fdoruct  399        default:
 395      r/a>-> 395      ft_ko   ifyth *)KERN_ERR "%d\n"r *):
ibft_kobft_kobjec href="+code=ibft_kobjecclasy" class="sref">entr_nic * 415  r/a>->                break;
 327                break;
 405
 395      bookobjec>pbookobsea href="+code=ibbookobseaclasuot;%d\n"r *)entrende="+code=subnet_mende=classBOOT_ETH_PRIMARY_DNS:
ibft_kobft_kobjec href="+code=ibft_kobjecclassBOOT_ETH_PRIMARY_DNS:
 418ibft_kobft_koattr_showtruct  418ibft_kobft_ko ibft_kobft_koruct_rele="L href="+code=ibft_kobjec_rele="Lintks                break;
ibft_kobbookobjec>type) {
 395      r/a>->                rMEM href="+code=ib  rMEMic"                 break;
 383 395      freLf="dr_jec>                break;
 337        }
 327                break;
 366   edftarget href="+code=ibfdftargetic" "> 399        default:
 395      r/a>-> 395      ft_ko   ifyth *)KERN_ERR "%d\n"r *):
 418ibft_kobft_kobjec href="+code=ibft_kobjecclasy" class="sref">entr>str,  415  r/a>->                break;
 327                break;
 395      bookobjec>pbookobsea href="+code=ibbookobseaclasuot;%d\n"r *)entrende="+code=subnet_mende=classBOOT_ETH_PRIMARY_DNS:
 383 395      ft_kobjec href="+code=ibft_kobjecclassBOOT_ETH_PRIMARY_DNS:
 383 395      ft_koattr_showttarget href="+code=ibft_koattr_showttargetclassBOOT_ETH_PRIMARY_DNS:
 395      ft_ko  395      ft_koruct_rele="L href="+code=ibft_kobjec_rele="Lintks                break;
ibft_kobbookobjec>type) {
 418 395      r/a>->                rMEM href="+code=ib  rMEMic"                 break;
 395      freLf="dr_jec>                break;
 337        }
 327                break;
 366   edfreserv>d href="+code=ibfdfreserv>dic" "> 399        default:
 303   fdfcontrol href="+code=ibfdfcontrolic" "> 399        default:
 374   idtextensioa href="+code=secidtextensioa ic" "> 399        default:
 414        Fields which we don't support. Ignore them *anity checking of iBFT. */
 395      r/a>->                break;
 327                break;
 399        default:
 395      pN_Etka>->pe=KE_ERode=ISCSI_BOOT_Te=KE_ERos="li ass="sref">KERN_ERR &q \> 399        default:
 414ERN_ERR "%d\n"r *)entred href="+code=ibfdclassBOOT_ETH_PRIMARY_DNS:
 391 395      r->ibft_addr->ibft_addoem_ed href="+code=iboem_edintks                break;
 395      r/a>->                break;
 327                break;
 337        }
 405
 415  r/a>->type) {
 414        Skip add_ER this bject" , but exit with non-fatal error. *anity checking of iBFT. */
 378      r/a>->csum = 0;
 395      freLf="dr_jec>                break;
 337        }
 415  r *)entred href="+code=ibfdclas =ic> 395      edtruct type) {
 414       nity checking of iBFT. */
 414     ine" name="L383"* We don't search e="Ltheme=vice in other domainsLthannity checking of iBFT. */
 414      ne" name="L383"* zero. This is becau"L3on x86 plate="msLthemBIOSnity checking of iBFT. */
 414      ne" name="L383"* executes3onlyme=vices which n>
 in domain 0. Furthermore,Lthenity checking of iBFT. */
 414      ne" name="L383"* pBFT spec doesn't have a domain id field :-(nity checking of iBFT. */
 414      ne" name="L383"*anity checking of iBFT. */
 395      pci_dev> 395      pci_get_bus_and_slot href="+code=ibpci_get_bus_and_slotintk"L415"> 415  _nic *entrpci_bdf href="+code=ibpci_bdfic" c& 0xff00) " cl" cl 8sBOOT_ETH_PRIMARY_DNS:
 415  _nic *entrpci_bdf href="+code=ibpci_bdfic" c& 0xff)s                break;
type) {
 395      r/a>-> 395      sysfso< 32tetc#Lka>->ibft_kobbookobjec>entrbjec> 383ibft_kobpci_dev>entrdev>ibft_addbjec> 414ERN_ERR &qs                break;
 383ibft_kobpci_dev_put href="+code=ibpci_dev_putintk" class="sref">ppci_dev>                break;
 337        }
 337        }
 419csum = 0;
 338
 399        default:
 410pft_kobjec href="+code=ibft_kobjecclas)                break;
 403     r/a>->                break;
 337        }
 413
 414       nity checking of iBFT. */
 414      * ScL41themIBFT tableme="L28ure e="LthemNIC and Target fields. Whennity checking of iBFT. */
 414      * e=und add them o41themp> 4ed-in list. We do not support1themothernity checking of iBFT. */
 414      * fields at this point, so1they n>
 skipped.nity checking of iBFT. */
 414      *anity checking of iBFT. */
 406static int __initregisterobject" s href="+code=ibft_koregisterobject" sintk"e="L288"> 288     acpi_tablef="dr href="+code=ibacpi_tablef="drclass="sref">ibft_kobr->type) {
 288        stcontrol href="+code=ibf  stcontrolclass="sref">ibft_kobcontrol href="+code=ibcontrolclassic> 395      NULL>iattr_show_target                break;
 406sr/a>->csum = 0;
 406suiscsi_ibft. href=u1ss="li"sref">ibft_addoffsea href="+code=iboffseaode=                break;
 406suiscsi_ibft. href=u1ss="li"sref">ibft_addeokooffsea href="+code=ibeokooffseaode=                break;
csum = 0;
ibft_kobcontrol href="+code=ibcontrolclassic"f">iatu8" class="sref"h->ibft_kobr->iatu8" class="sref"control href="+code=ibcontrolclass+m"sref">ibft_kobcontrol href="+code=ibcontrolclaslass="sref">ibft_addr *)ibft_addlength)iatu8" class="sref"h-> 395      r->ibft_addr->ibft_addlength)iatu8" class="sref"control href="+code=ibcontrolclas                break;
 410-> 395      ft_ko   ifyth *)KERN_ERR &quo"e="L288"> 288        sth *):
 391ibft_kobcontrol href="+code=ibcontrolclas)s                break;
 402
 414        iBFT tablemeafety  _ER *anity checking of iBFT. */
 406sr/a>->pcontrol href="+code=ibcontrolclaslass="sref">ibft_addr *)ibft_addende="+code=subnet_mende=clas) ?ca>                rDEV"+code=subnet_m  rDEVode=n: 0s                break;
 415  r/a>->type) {
->pe=KE_ERode=ISCSI_BOOT_Te=KE_ERos="li ass="sref">KERN_ERR &qs                break;
 403     r/a>->                break;
 337        }
ppt->ibft_kobcontrol href="+code=ibcontrolclaslass="sref">ibft_adde=__iatoraoff"+code=subnet_men__iatoraoffode=<"tr_show_targetpuiscsi_ibft. href=u1ss="l))e" class="sref">type) {
ibft_koboffsea href="+code=iboffseaode=nic*" class="sref">puiscsi_ibft. href=u1ss="ls=u8" class="sref"pt-> 415  offsea href="+code=iboffseaode=n&& 415"> 415  offsea href="+code=iboffseaode=n<<"tr_show_target->ibft_addr->ibft_addlength)ibft_koboffsea href="+code=iboffseaode=n<<"tr_show_targettype) {
ibft_kobr/a>-> 395      ft_koc 32tetruct ibft_addr->iatu8" class="sref"h-> 395      offsea href="+code=iboffseaode=s                break;
 415  r/a>->                break;
 327                break;
 337        }
 337        }
 403     r/a>->                break;
 337        }
 402
ia"> 288        stunregister href="+code=ibft_kounregisterintk"f">i)/a>                break;
type) {
 288       hrefbookobjec>ibft_kobbookobjec>                break;
 288        struct ibft_kobft_kobjec href="+code=ibft_kobjecclas                break;
ibft_addbookobjec>:
ibft_kobbookobsea href="+code=ibbookobseaclasy" class="sref">entrbjec_list href="+code=ibbjec_listclasuotr_show_targettype) {
ibft_kobft_kobjec href="+code=ibft_kobjecclasnic> 395      bookobjec>entr/a>(void * 415  ft_kobjec href="+code=ibft_kobjecclaslass="sref">ibft_addr *)entred href="+code=ibfdclas =ic> 395      edtruct                 break;
ibft_kobsysfsoremovetc#Lka>->ibft_kobbookobjec>entrbjec> 414ERN_ERR &qs                break;
                break;
 337        }
 405
ia"> 288        stcleanup href="+code=ibft_koi)/a>                break;
type) {
 415  bookobsea href="+code=ibbookobseaclas)e" class="sref">type) {
 288        stunregister href="+code=ibft_kounregisterintk"s                break;
 288       hrefbookodeERNoyobsea href="+code=ib  hrefbookodeERNoyobseaintk""sref">ibft_addbookobsea href="+code=ibbookobseaclas)                break;
 337        }
 337        }
 413
ia"> 288     __exit href="+code=ib__exits="li > 288        stexit href="+code=ib   stexitintk"f">i)/a>                break;
type) {
ibft_kobft_kocleanup href="+code=ibft_ko                break;
 337        }
 338
ibft_kobCONFIG_ACPI href="+code=ibCONFIG_ACPIs="line" name="L338"> 338
type) {
ibft_kobsigna>->                break;
ibft_kobft_kosigns href="+code=ibft_kosignss="l[]nic" class="sref">type) {
 414       nity checking of iBFT. */
 414     ine" name* One spec says s="strIBFTs="str,1themother says s="striBFTs="str. We have to  nity checking of iBFT. */
 414      ne" name*me="Lboth.nity checking of iBFT. */
 414      ne" name*anity checking of iBFT. */
ibft_kobACPI_SIG_IBFT href="+code=ibACPI_SIG_IBFTs="li}sBOOT_ETH_PRIMARY_DNS:
KERN_ERR &q }sBOOT_ETH_PRIMARY_DNS:
ia"> 288     __tic int _acpi_find_ft_koregiona>->i)/a>                break;
type) {
 406si href="+code=ibfe=da                break;
 288     acpi_tablefh->ibft_kobtable>                break;
 405
 415  acpi_disabled href="+code=ibacpi_disabledic" )/a>                break;
 338
pi href="+code=ibfe=danic c"L406"> 406si href="+code=ibfe=dan<<"tr_show_targetibft_addft_kosigns href="+code=ibft_kosignss="l)n&& !"sref">ibft_kobft_koad *)type) {
 415  acpi_get_table>ibft_addft_kosigns href="+code=ibft_kosignss="l[tr_show_targetibft_addsigna>->ibft_kobtable>ibft_kobft_koad *) 288     acpi_tablef="dr href="+code=ibacpi_tablef="drclass=u8" class="sref"table> 337        }
 337        }
 337        }
ia"> 288     __tic int _acpi_find_ft_koregiona>->i)/a>                break;
type) {
 337        }
 337        }
 414       nity checking of iBFT. */
 414      * ft_koe=__() - < 32tes sysfs tree entries e="LthempBFT +cod.nity checking of iBFT. */
 414      *anity checking of iBFT. */
 406static int __inittic int i)/a>                break;
type) {
 406sr/a>->csum = 0;
csum = 0;
 414       nity checking of iBFT. */
 414                As3on UEFI systemsLthems="Lp_arch()/find_ft_koregion()nity checking of iBFT. */
 414                is called before ACPI tables n>
 parsed and it3onlymeoesnity checking of iBFT. */
 414                legacy finding.nity checking of iBFT. */
 414             *anity checking of iBFT. */
ibft_kobft_koad *)_acpi_find_ft_koregiona>->                break;
 415  ft_koad *)type) {
KERN_ERR &qs                break;
 378      r/a>->ibft_kobft_koc/a>                 break;
 415  r/a>->                break;
 403     r/a>->                break;
 395      bookobsea href="+code=ibbookobseaclassic> 395      eshrefbooko< 32tetbsea href="+code=ib  hrefbooko< 32tetbseaintk""ass="sref">KERN_ERR &qs                break;
ibft_kobbookobsea href="+code=ibbookobseaclas)/a>                break;
                break;
 405
 414        ScL41themIBFT e="L+cod and register1thembject" s. *anity checking of iBFT. */
 378      r/a>->ibft_kobft_koregisterobject" s href="+code=ibft_koregisterobject" sintk"415"> 415  ft_koad *) 415  r/a>->                break;
 395      out_freL href="+code=ibout_freLic"                 break;
 337        }
->pe=KE_INFOa>->KERN_ERR &qs                break;
 402
 419csum = 0;
 399        default:
ibft_kobft_kocleanup href="+code=ibft_ko                break;
 419 403     r/a>->                break;
 337        }
 403     modulef=ic int  415  ft_kotic int  403     modulefexit href="+code=ibmodulefexitintk"415"> 415  ft_koexit href="+code=ib   stexitintk)                break;

Themoriginal LXR softak;
 by1thema>       http://sourceforge.net/proct" s/lxr">LXR uic ye=da, this experi>   al     ion by1a>       mailto:lxr@c#Lux.no">lxr@c#Lux.noe=da.
lxr.c#Lux.no kindly hosted by1a> http://www.redpill-c#Lpro.no">Redpill L#Lpro ASe=da, provi=he of L#Luxaconsult_ER and operatioa services since 1995.