History log of /drivers/firmware/iscsi_ibft.c
Revision Date Author Comments
587a1f1659e8b330b8738ef4901832a2b63f0bed 24-Jul-2011 Al Viro <viro@zeniv.linux.org.uk> switch ->is_visible() to returning umode_t

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
935a9fee51c945b8942be2d7b4bae069167b4886 12-Dec-2011 Yinghai Lu <yinghai.lu@oracle.com> ibft: Fix finding IBFT ACPI table on UEFI

Found one system with UEFI/iBFT, kernel does not detect the iBFT during
iscsi_ibft module loading.

Root cause: on x86 (UEFI), we are calling of find_ibft_region() much earlier
- specifically in setup_arch() before ACPI is enabled.

Try to split acpi checking code out and call that later

At that time ACPI iBFT already get permanent mapped with ioremap.
So isa_virt_to_bus() will get wrong phys from right virt address.
We could just skip that phys address printing.

For legacy one, print the found address early.

-v2: update comments and description according to Konrad.
-v3: fix problem about module use case that is found by Konrad.
-v4: use acpi_get_table() instead of acpi_table_parse() to handle module use case that is found by Konrad again..
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
f457a46f179df41b0f6d80dee33b6e629945f276 24-Jun-2011 Mike Christie <michaelc@cs.wisc.edu> [SCSI] iscsi_ibft, be2iscsi, iscsi_boot: fix boot kobj data lifetime management

be2iscsi passes the boot functions its phba object which is
allocated in the shost, but iscsi_ibft passes in a object
allocated for each item to display. The problem is that
iscsi_boot_sysfs was managing the lifetime of the object
passed in and doing a kfree on release. This causes a double
free for be2iscsi which frees the shost in its pci_remove.

This patch fixes the problem by adding a release callback
which the drivers can call kfree or a put() type of function
(needed for be2iscsi which will do a get/put on the shost).

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
85ee7a1d39d75d23d21f3871f6dc9b87d572747a 24-Apr-2011 Joe Perches <joe@perches.com> treewide: cleanup continuations and remove logging message whitespace

Using C line continuation inside format strings is error prone.
Clean up the unintended whitespace introduced by misuse of \.
Neaten correctly used line continations as well for consistency.

drivers/scsi/arcmsr/arcmsr_hba.c has these errors as well,
but arcmsr needs a lot more work and the driver should likely be
moved to staging instead.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
a12415ff589ac5106e6b489f44c947b565fcb963 11-Aug-2010 Konrad Rzeszutek Wilk <konrad@kernel.org> ibft: Kernel oops when rmmoding iscsi_ibft with no iBFT present.

We failed to check to see if actually allocated structures
to contain the iBFT structure and went ahead to dereference it.

This patch fixes the OOPS.

Reported-by: "Jayamohan Kalickal" <jayamohank@serverengines.com>  
Tested-by: "Jayamohan Kalickal" <jayamohank@serverengines.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Peter Jones <pjones@redhat.com>
 
b33a84a384776fb2593dac4d77c72050f9e181b0 12-Apr-2010 Mike Christie <michaelc@cs.wisc.edu> ibft: convert iscsi_ibft module to iscsi boot lib

This patch just converts the iscsi_ibft module to the
iscsi boot sysfs lib module.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Peter Jones <pjones@redhat.com>
4e639fdf0d0d745648aa62228ab8a0d9c03a563f 25-Feb-2010 Peter Jones <pjones@redhat.com> ibft: Update iBFT handling for v1.03 of the spec.

- Use struct acpi_table_ibft instead of struct ibft_table_header
- Don't do reserve_ibft_region() on UEFI machines (section 1.4.3.1)
- If ibft_addr isn't initialized when ibft_init() is called, check for
ACPI-based tables.
- Fix compiler error when CONFIG_ACPI is not defined.

Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
52cf25d0ab7f78eeecc59ac652ed5090f69b619e 19-Jan-2010 Emese Revfy <re.emese@gmail.com> Driver core: Constify struct sysfs_ops in struct kobj_type

Constify struct sysfs_ops.

This is part of the ops structure constification
effort started by Arjan van de Ven et al.

Benefits of this constification:

* prevents modification of data that is shared
(referenced) by many other structure instances
at runtime

* detects/prevents accidental (but not intentional)
modification attempts on archs that enforce
read-only kernel data at runtime

* potentially better optimized code as the compiler
can assume that the const data cannot be changed

* the compiler/linker move const data into .rodata
and therefore exclude them from false sharing

Signed-off-by: Emese Revfy <re.emese@gmail.com>
Acked-by: David Teigland <teigland@redhat.com>
Acked-by: Matt Domsch <Matt_Domsch@dell.com>
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Acked-by: Hans J. Koch <hjk@linutronix.de>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
00e7825b943f486e80ff1305cd0594d8791870f8 14-Jan-2010 Joe Perches <joe@perches.com> drivers/firmware/iscsi_ibft.c: remove NIPQUAD_FMT, use %pI4

Convert netmask to __be32 and format it with %pI4

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Konrad Rzeszutek <ketuzsezr@darnok.org>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: Peter Jones <pjones@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2c35294853b2e977bdfc9e401b7b6d881fcaa69b 05-Jan-2010 hartleys <hartleys@visionengravers.com> drivers/firmware/iscsi_ibft.c: use %pM to show MAC address

Use the %pM kernel extension to display the MAC address.

Also, remove the 'mac' variable and use nic->mac directly.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Peter Jones <pjones@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
ed3c661448a1b4b0b07c0a0d3c6e8a19c7d0ffd7 02-Oct-2009 Jan Beulich <JBeulich@novell.com> iSCSI/iBFT: use proper address translation

In virtual environments (namely, Xen Dom0) virt <-> phys and
virt <-> isa-bus translations cannot be freely interchanged (and
even outside such environments it is not really correct to do so).
When looking at memory below 1M, the latter translations should
always be used.

iscsi_ibft_find.c part from: Martin Wilck <martin.wilck@ts.fujitsu.com>.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <ketuzsezs@darnok.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
65fd21058a791f35aff11eeccd2e270f0faf11ec 01-May-2009 Ashutosh Naik <ashutosh.naik@gmail.com> ibft: fix the display of a few fields in the NIC attribute structure in sysfs

Fix the display of a few fields in the iBFT NIC attribute structure in
sysfs.

Ensure that, if the DHCP IP address and the subnet mask for the interface
is present in the iBFT NIC structure, the corresponding entries are
created in sysfs tree for the device. This would hence create the
additional entries in the tree based on the iBFT table and would not
delete any existing entries.

Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
Cc: Vishnu V <vishnu@chelsio.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
f537a53da9389f56df277057684df23997410e9c 11-Feb-2009 Jaswinder Singh Rajput <jaswinderrajput@gmail.com> iscsi_ibft.c fix compilation warning

drivers/firmware/iscsi_ibft.c: In function ‘ibft_init’:
drivers/firmware/iscsi_ibft.c:942: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 2 has type ‘phys_addr_t’

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
63779436ab4ad0867bcea53bf853b0004d7b895d 31-Oct-2008 Harvey Harrison <harvey.harrison@gmail.com> drivers: replace NIPQUAD()

Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u
can be replaced with %pI4

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5b095d98928fdb9e3b75be20a54b7a6cbf6ca9ad 29-Oct-2008 Harvey Harrison <harvey.harrison@gmail.com> net: replace %p6 with %pI6

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1afa67f5e70b4733d5b237df61e6d639af6283bb 29-Oct-2008 Harvey Harrison <harvey.harrison@gmail.com> misc: replace NIP6_FMT with %p6 format specifier

The iscsi_ibft.c changes are almost certainly a bugfix as the
pointer 'ip' is a u8 *, so they never print the last 8 bytes
of the IPv6 address, and the eight bytes they do print have
a zero byte with them in each 16-bit word.

Other than that, this should cause no difference in functionality.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
01e8ef11bc1a74e65678ed55795f59266d4add01 19-Oct-2008 Parag Warudkar <parag.lkml@gmail.com> x86: sysfs: kill owner field from attribute

Tejun's commit 7b595756ec1f49e0049a9e01a1298d53a7faaa15 made sysfs
attribute->owner unnecessary. But the field was left in the structure to
ease the merge. It's been over a year since that change and it is now
time to start killing attribute->owner along with its users - one arch at
a time!

This patch is attempt #1 to get rid of attribute->owner only for
CONFIG_X86_64 or CONFIG_X86_32 . We will deal with other arches later on
as and when possible - avr32 will be the next since that is something I
can test. Compile (make allyesconfig / make allmodconfig / custom config)
and boot tested.

akpm: the idea is that we put the declaration of sttribute.owner inside
`#ifndef CONFIG_X86'. But that proved to be too ambitious for now because
new usages kept on turning up in subsystem trees.

[akpm: remove the ifdef for now]
Signed-off-by: Parag Warudkar <parag.lkml@gmail.com>
Cc: Greg KH <greg@kroah.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9cf899d12583082c77a0fcc758f3179b440518ee 12-Aug-2008 Adrian Bunk <bunk@kernel.org> drivers/firmware/iscsi_ibft.c: make 3 functions static

This patch makes the following needlessly global functions static:
- ibft_attr_show_initiator()
- ibft_attr_show_nic()
- ibft_attr_show_target()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Konrad Rzeszutek <ketuzsezr@darnok.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
bb8fb4e6840ecebdc61f7ebd0653187e7128dde5 02-Sep-2008 Mike Christie <michaelc@cs.wisc.edu> ibft: fix target info parsing in ibft module

I got this patch through Red Hat's bugzilla from the bug submitter and
patch creator. I have just fixed it up so it applies without fuzz to
upstream kernels.

Original patch and description from Shyam kumar Iyer:

The issue [ibft module not displaying targets with short names] is because
of an offset calculatation error in the iscsi_ibft.c code. Due to this
error directory structure for the target in /sys/firmware/ibft does not
get created and so the initiator is unable to connect to the target.

Note that this bug surfaced only with an name that had a short section at
the end. eg: "iqn.1984-05.com.dell:dell". It did not surface when the
iqn's had a longer section at the end. eg:
"iqn.2001-04.com.example:storage.disk2.sys1.xyz"

So, the eot_offset was calculated such that an extra 48 bytes i.e. the
size of the ibft_header which has already been accounted was subtracted
twice.

This was not evident with longer iqn names because they would overshoot
the total ibft length more than 48 bytes and thus would escape the bug.

Signed-off-by: Shyam Kumar Iyer <shyam_iyer@dell.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Cc: Konrad Rzeszutek <konrad@virtualiron.com>
Cc: Peter Jones <pjones@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
138fe4e069798d9aa948a5402ff15e58f483ee4e 10-Apr-2008 Konrad Rzeszutek <ketuzsezr@darnok.org> Firmware: add iSCSI iBFT Support

Add /sysfs/firmware/ibft/[initiator|targetX|ethernetX] directories along with
text properties which export the the iSCSI Boot Firmware Table (iBFT)
structure.

What is iSCSI Boot Firmware Table? It is a mechanism for the iSCSI tools to
extract from the machine NICs the iSCSI connection information so that they
can automagically mount the iSCSI share/target. Currently the iSCSI
information is hard-coded in the initrd. The /sysfs entries are read-only
one-name-and-value fields.

The usual set of data exposed is:

# for a in `find /sys/firmware/ibft/ -type f -print`; do echo -n "$a: "; cat $a; done
/sys/firmware/ibft/target0/target-name: iqn.2007.com.intel-sbx44:storage-10gb
/sys/firmware/ibft/target0/nic-assoc: 0
/sys/firmware/ibft/target0/chap-type: 0
/sys/firmware/ibft/target0/lun: 00000000
/sys/firmware/ibft/target0/port: 3260
/sys/firmware/ibft/target0/ip-addr: 192.168.79.116
/sys/firmware/ibft/target0/flags: 3
/sys/firmware/ibft/target0/index: 0
/sys/firmware/ibft/ethernet0/mac: 00:11:25:9d:8b:01
/sys/firmware/ibft/ethernet0/vlan: 0
/sys/firmware/ibft/ethernet0/gateway: 192.168.79.254
/sys/firmware/ibft/ethernet0/origin: 0
/sys/firmware/ibft/ethernet0/subnet-mask: 255.255.252.0
/sys/firmware/ibft/ethernet0/ip-addr: 192.168.77.41
/sys/firmware/ibft/ethernet0/flags: 7
/sys/firmware/ibft/ethernet0/index: 0
/sys/firmware/ibft/initiator/initiator-name: iqn.2007-07.com:konrad.initiator
/sys/firmware/ibft/initiator/flags: 3
/sys/firmware/ibft/initiator/index: 0

For full details of the IBFT structure please take a look at:
ftp://ftp.software.ibm.com/systems/support/system_x_pdf/ibm_iscsi_boot_firmware_table_v1.02.pdf

[akpm@linux-foundation.org: fix build]
Signed-off-by: Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Peter Jones <pjones@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>