Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Matt Domsch
On Wed, Jul 20, 2005 at 12:54:09PM -0500, Nathan Lynch wrote:
> Matt Domsch wrote:
> > On Tue, Jul 19, 2005 at 06:07:41PM -0600, Moore, Eric Dean wrote:
> > > On Tuesday, July 12, 2005 8:17 PM, Matt Domsch wrote:
> > > > In general, this construct:
> > > > 
> > > > > > -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
> > > > > > -static int inline scsi_device_online(struct scsi_device *sdev)
> > > > > > -{
> > > > > > -   return sdev->online;
> > > > > > -}
> > > > > > -#endif
> > > > 
> > > > is better tested as:
> > > > 
> > > > #ifndef scsi_device_inline
> > > > static int inline scsi_device_online(struct scsi_device *sdev)
> > > > {
> > > > return sdev->online;
> > > > }
> > > > #endif
> > > > 
> > > > when you can.  It cleanly eliminates the version test, and tests for
> > > > exactly what you're looking for - is this function defined.
> > > > 
> > > 
> > > What you illustrated above is not going to work.
> > > If your doing #ifndef around a function, such as scsi_device_online, it's
> > > not going to compile
> > > when scsi_device_online is already implemented in the kernel tree.
> > > The routine scsi_device_online is a function, not a define.  For a define
> > > this would work.
> > 
> > Sure it does, function names are defined symbols.
> > 
> 
> $ cat foo.c
> static int foo(void) { return 0; }
> #ifndef foo
> static int foo(void) { return 0; }
> #endif
> 
> $ gcc -c foo.c
> foo.c:3: error: redefinition of 'foo'
> foo.c:1: error: previous definition of 'foo' was here
> 
> I believe #ifdef/#ifndef can test only preprocessor symbols.


I was mistaken. Christoph explained to me that it worked on 2.4 due to
the way module symbol versions worked, but isn't that way on 2.6
anymore.  My apologies.

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Nish Aravamudan
On 7/19/05, Moore, Eric Dean <[EMAIL PROTECTED]> wrote:
> On Tuesday, July 12, 2005 8:17 PM, Matt Domsch wrote:
> > In general, this construct:
> >
> > > > -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
> > > > -static int inline scsi_device_online(struct scsi_device *sdev)
> > > > -{
> > > > - return sdev->online;
> > > > -}
> > > > -#endif
> >
> > is better tested as:
> >
> > #ifndef scsi_device_inline
> > static int inline scsi_device_online(struct scsi_device *sdev)
> > {
> > return sdev->online;
> > }
> > #endif
> >
> > when you can.  It cleanly eliminates the version test, and tests for
> > exactly what you're looking for - is this function defined.
> >
> 
> What you illustrated above is not going to work.
> If your doing #ifndef around a function, such as scsi_device_online, it's
> not going to compile
> when scsi_device_online is already implemented in the kernel tree.
> The routine scsi_device_online is a function, not a define.  For a define
> this would work.
> 
> I'm trying your example around msleep, msleep_interruptible, and
> msecs_to_jiffies, and
> my code simply won't compile in SLES9 SP2(-191).  In SLES9 SP1(-139), these
> three routines were not implemented and
> your suggestion works.  I won't be able to to a linux version check as this
> change occurred between service packs
> of the 2.6.5 kernel suse tree.   Anybody on the linux forums have any ideas?
> 
> Example:
> 
> #ifdef msleep
> static void inline msleep(unsigned long msecs)
> {
> set_current_state(TASK_UNINTERRUPTIBLE);
> schedule_timeout(msecs_to_jiffies(msecs) + 1);
> }
> #endif

Just an FYI, if you are trying to emulate the actual behavior of
msleep() in the current kernel via this function, then you need to
place the sleep in a while-loop. Please see kernel/timer.c::msleep().
Your version will wake up on wait-queue events, while msleep() in the
current kernel does not.

Thanks,
Nish
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Nathan Lynch
Matt Domsch wrote:
> On Tue, Jul 19, 2005 at 06:07:41PM -0600, Moore, Eric Dean wrote:
> > On Tuesday, July 12, 2005 8:17 PM, Matt Domsch wrote:
> > > In general, this construct:
> > > 
> > > > > -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
> > > > > -static int inline scsi_device_online(struct scsi_device *sdev)
> > > > > -{
> > > > > - return sdev->online;
> > > > > -}
> > > > > -#endif
> > > 
> > > is better tested as:
> > > 
> > > #ifndef scsi_device_inline
> > > static int inline scsi_device_online(struct scsi_device *sdev)
> > > {
> > > return sdev->online;
> > > }
> > > #endif
> > > 
> > > when you can.  It cleanly eliminates the version test, and tests for
> > > exactly what you're looking for - is this function defined.
> > > 
> > 
> > What you illustrated above is not going to work.
> > If your doing #ifndef around a function, such as scsi_device_online, it's
> > not going to compile
> > when scsi_device_online is already implemented in the kernel tree.
> > The routine scsi_device_online is a function, not a define.  For a define
> > this would work.
> 
> Sure it does, function names are defined symbols.
> 

$ cat foo.c
static int foo(void) { return 0; }
#ifndef foo
static int foo(void) { return 0; }
#endif

$ gcc -c foo.c
foo.c:3: error: redefinition of 'foo'
foo.c:1: error: previous definition of 'foo' was here

I believe #ifdef/#ifndef can test only preprocessor symbols.

Nathan
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [-mm patch] SCSI_QLA2ABC options must select FW_LOADER

2005-07-20 Thread Jesper Juhl
On 7/19/05, Adrian Bunk <[EMAIL PROTECTED]> wrote:
> [ The subject was adapted to linux-kernel spam filters... ]
> 
> On Sat, Jul 16, 2005 at 07:26:44PM +0200, Jindrich Makovicka wrote:
> > Andrew Vasquez wrote:
> > > Yes, quite.  How about the following to correct the intention.
> > >
> > >
> > >
> > > Add correct Kconfig option for ISP24xx support.
> > >
> > > Signed-off-by: Andrew Vasquez <[EMAIL PROTECTED]>
> > > ---
> > >
> > > diff --git a/drivers/scsi/qla2xxx/Kconfig b/drivers/scsi/qla2xxx/Kconfig
> > > --- a/drivers/scsi/qla2xxx/Kconfig
> > > +++ b/drivers/scsi/qla2xxx/Kconfig
> > > @@ -39,3 +39,11 @@ config SCSI_QLA6312
> > > ---help---
> > > This driver supports the QLogic 63xx (ISP6312 and ISP6322) host
> > > adapter family.
> > > +
> > > +config SCSI_QLA24XX
> > > +   tristate "QLogic ISP24xx host adapter family support"
> > > +   depends on SCSI_QLA2XXX
> > > +select SCSI_FC_ATTRS
> >
> > there should be also "select FW_LOADER", as it uses request_firmware &
> > release_firmware
> >...
> 
> You are right, patch below.
> 
> > Jindrich Makovicka
> 
> cu
> Adrian
> 
> 
> <--  snip  -->
> 
> 
> qla_init.c now uses code that requires FW_LOADER.
> 
> Additionally, this patch removes spaces instead of tabs at the
> SCSI_FC_ATTRS selects.
> 
> Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
> 
> --- linux-2.6.13-rc3-mm1-full/drivers/scsi/qla2xxx/Kconfig.old  2005-07-17 
> 15:44:26.0 +0200
> +++ linux-2.6.13-rc3-mm1-full/drivers/scsi/qla2xxx/Kconfig  2005-07-17 
> 15:45:45.0 +0200
> @@ -1,49 +1,55 @@
>  config SCSI_QLA2XXX
> tristate
> depends on SCSI && PCI
> default y
> 
>  config SCSI_QLA21XX
> tristate "QLogic ISP2100 host adapter family support"
> depends on SCSI_QLA2XXX
> -select SCSI_FC_ATTRS
> +   select SCSI_FC_ATTRS
> +   select FW_LOADER
> ---help---
> This driver supports the QLogic 21xx (ISP2100) host adapter family.
> 
>  config SCSI_QLA22XX
> tristate "QLogic ISP2200 host adapter family support"
> depends on SCSI_QLA2XXX
> -select SCSI_FC_ATTRS
> +   select SCSI_FC_ATTRS
> +   select FW_LOADER
> ---help---
> This driver supports the QLogic 22xx (ISP2200) host adapter family.
> 
>  config SCSI_QLA2300
> tristate "QLogic ISP2300 host adapter family support"
> depends on SCSI_QLA2XXX
> -select SCSI_FC_ATTRS
> +   select SCSI_FC_ATTRS
> +   select FW_LOADER
> ---help---
> This driver supports the QLogic 2300 (ISP2300 and ISP2312) host
> adapter family.
> 
>  config SCSI_QLA2322
> tristate "QLogic ISP2322 host adapter family support"
> depends on SCSI_QLA2XXX
> -select SCSI_FC_ATTRS
> +   select SCSI_FC_ATTRS
> +   select FW_LOADER
> ---help---
> This driver supports the QLogic 2322 (ISP2322) host adapter family.
> 
>  config SCSI_QLA6312
> tristate "QLogic ISP63xx host adapter family support"
> depends on SCSI_QLA2XXX
> -select SCSI_FC_ATTRS
> +   select SCSI_FC_ATTRS
> +   select FW_LOADER
> ---help---
> This driver supports the QLogic 63xx (ISP6312 and ISP6322) host
> adapter family.
> 
>  config SCSI_QLA24XX
> tristate "QLogic ISP24xx host adapter family support"
> depends on SCSI_QLA2XXX
> -select SCSI_FC_ATTRS
> +   select SCSI_FC_ATTRS
> +   select FW_LOADER
> ---help---
> This driver supports the QLogic 24xx (ISP2422 and ISP2432) host
> adapter family.

I send a patch for this yesterday that lets SCSI_QLA2XXX select
FW_LOADER. I believe that's a bit better since the other options
depend on SCSI_QLA2XXX anyway, there's no point in having them all set
FW_LOADER. My patch also fixes another little issue; that you cannot
disable SCSI_QLA2XXX if you don't need it.

See the patch here: http://lkml.org/lkml/2005/7/19/147
The mail contains 3 patches, but the third one is the best fix IMHO.

-- 
Jesper Juhl <[EMAIL PROTECTED]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please  http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: lsscsi-0.15 released

2005-07-20 Thread Martin Peschke3
Doug,

Providing udev names is great. Makes it more user-frendly.

Btw., what do you think about this idea:
If lsscsi was enhanced to provide certain transport specific attributes, as
well,
then a user could easily look up the Linux device name of a logical unit
that he otherwise knows by its transport specific addressing, like WWPN and
so on in case of Fibre Channel. That's desirable, because
SAN management is done based on these transport specific addresses.

I guess, this would require to convince James that it makes sense to
spend effort on teaching either the midlayer or transport class to keep
track
of FCP_LUNs, or 64 bit LUNs respectively :)

Martin Peschke




|-+>
| |   Douglas Gilbert  |
| |   <[EMAIL PROTECTED]>   |
| |   Sent by: |
| |   [EMAIL PROTECTED]|
| |   .kernel.org  |
| ||
| ||
| |   20/07/2005 10:33 |
| |   Please respond to|
| |   dougg|
| ||
|-+>
  
>---|
  | 
  |
  |   To:   linux-scsi@vger.kernel.org  
  |
  |   cc:   [EMAIL PROTECTED]   
|
  |   Subject:  lsscsi-0.15 released
  |
  | 
  |
  
>---|




lsscsi is a utility that uses sysfs in linux 2.6 series kernels
to list information about all SCSI devices and SCSI hosts. Both a
compact format (default) which is one line
per device and a "classic" format (like the output of
'cat /proc/scsi/scsi') are supported. Some examples:

$ lsscsi
[0:0:0:0]diskLinuxscsi_debug   0004  /dev/sda
[1:0:6:0]tapeSONY SDT-7000 0192  /dev/st0

$ lsscsi --classic
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
   Vendor: LinuxModel: scsi_debug   Rev: 0004
   Type:   Direct-AccessANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 06 Lun: 00
   Vendor: SONY Model: SDT-7000 Rev: 0192
   Type:   Sequential-AccessANSI SCSI revision: 02

Version 0.15 is available at
http://www.torque.net/scsi/lsscsi.html

This is an experimental version that attempts to find the device
name used in the /dev directory rather than the kernel generated
name. The kernel generated name of the first SCSI disk discovered
is /dev/sda . However in the lk 2.6 series kernels udev may be
used to give this device some other name in the /dev directory,
for example /dev/root_disk . By default this version will search
for the device node name in the /dev directory whose type (i.e.
block or char), major and minor numbers match the kernel device
information found in sysfs. This change makes a SCSI (or USB,
Firewire, etc) CD/DVD drive appear with a name like /dev/scd0
(as most distributions now use) rather than its kernel device
node name of sr0 used by sysfs. There are other ways this could be
done which would be more efficient in CPU usage, for example by
lsscsi using the udevinfo facilities internally. This version of
lsscsi can be given a '--kname' option to show the kernel
(i.e. sysfs) device node name instead. Note that sysfs and SCSI
errors and warning sent to the system log continue to use the
kernel device node name.

By default lsscsi lists all SCSI devices (or hosts). This version
allows select arguments to reduce the number of devices listed.
For example "lsscsi 1" will list all channels, targets and luns
within host1. A single SCSI device can be listed with
'lsscsi 1 0 0 0' (or 'lsscsi 1:0:0:0' or 'lsscsi [1:0:0:0]'). See
man page for more information. This version of lsscsi uses the
facilities of the scandir() library call to both select (filter)
and sort the SCSI devices (or hosts) it finds in sysfs. Since
libsysfs (version 1.2) doesn't have the ability to filter then
this version of lsscsi uses scandir() [and not libsysfs]. Evidently
a new version 2.0 API for libsysfs is under development (and I
have requested a scandir() like select+sort facility).

Extra SCSI device and host attributes (as found in lk 2.6.12) can
be seen by using the '--long' option twice (or more conveniently
using '-ll'). Attributes are listed as "=" pairs, one
per line (indented two spaces) whe

Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Matthew Wilcox
On Tue, Jul 19, 2005 at 10:12:49PM -0500, Matt Domsch wrote:
> > What you illustrated above is not going to work.
> > If your doing #ifndef around a function, such as scsi_device_online, it's
> > not going to compile
> > when scsi_device_online is already implemented in the kernel tree.
> > The routine scsi_device_online is a function, not a define.  For a define
> > this would work.
> 
> Sure it does, function names are defined symbols.

uh, not to the preprocessor, they aren't.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


lsscsi-0.15 released

2005-07-20 Thread Douglas Gilbert

lsscsi is a utility that uses sysfs in linux 2.6 series kernels
to list information about all SCSI devices and SCSI hosts. Both a
compact format (default) which is one line
per device and a "classic" format (like the output of
'cat /proc/scsi/scsi') are supported. Some examples:

$ lsscsi
[0:0:0:0]diskLinuxscsi_debug   0004  /dev/sda
[1:0:6:0]tapeSONY SDT-7000 0192  /dev/st0

$ lsscsi --classic
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: LinuxModel: scsi_debug   Rev: 0004
  Type:   Direct-AccessANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 06 Lun: 00
  Vendor: SONY Model: SDT-7000 Rev: 0192
  Type:   Sequential-AccessANSI SCSI revision: 02

Version 0.15 is available at
http://www.torque.net/scsi/lsscsi.html

This is an experimental version that attempts to find the device
name used in the /dev directory rather than the kernel generated
name. The kernel generated name of the first SCSI disk discovered
is /dev/sda . However in the lk 2.6 series kernels udev may be
used to give this device some other name in the /dev directory,
for example /dev/root_disk . By default this version will search
for the device node name in the /dev directory whose type (i.e.
block or char), major and minor numbers match the kernel device
information found in sysfs. This change makes a SCSI (or USB,
Firewire, etc) CD/DVD drive appear with a name like /dev/scd0
(as most distributions now use) rather than its kernel device
node name of sr0 used by sysfs. There are other ways this could be
done which would be more efficient in CPU usage, for example by
lsscsi using the udevinfo facilities internally. This version of
lsscsi can be given a '--kname' option to show the kernel
(i.e. sysfs) device node name instead. Note that sysfs and SCSI
errors and warning sent to the system log continue to use the
kernel device node name.

By default lsscsi lists all SCSI devices (or hosts). This version
allows select arguments to reduce the number of devices listed.
For example "lsscsi 1" will list all channels, targets and luns
within host1. A single SCSI device can be listed with
'lsscsi 1 0 0 0' (or 'lsscsi 1:0:0:0' or 'lsscsi [1:0:0:0]'). See
man page for more information. This version of lsscsi uses the
facilities of the scandir() library call to both select (filter)
and sort the SCSI devices (or hosts) it finds in sysfs. Since
libsysfs (version 1.2) doesn't have the ability to filter then
this version of lsscsi uses scandir() [and not libsysfs]. Evidently
a new version 2.0 API for libsysfs is under development (and I
have requested a scandir() like select+sort facility).

Extra SCSI device and host attributes (as found in lk 2.6.12) can
be seen by using the '--long' option twice (or more conveniently
using '-ll'). Attributes are listed as "=" pairs, one
per line (indented two spaces) when the '-lll' option is given.


ChangeLog:
Version 0.15 2005/6/29
  - option '-ll' gives more attributes and '-lll' gives attributes
one per line
  - change reporting if device node:
- use "match major+minor" with "/dev" directory (default)
- use synthetic device node names when '--kname' given
  {this was the default in earlier versions}
  - add filtering, sync with lk 2.6.12
{e.g. 'lsscsi 1' lists all SCSI devices on host1}
  - convert to autotools
  - builds on version 0.13 (does not use libsysfs)
{because dlist_sort_custom() does not have filter() callback}

Thanks to Nate Dailey for the /dev scanning code.

Comments welcome.

Doug Gilbert
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 22/82] remove linux/version.h from drivers/message/fus ion

2005-07-20 Thread Bernd Petrovitsch
On Tue, 2005-07-19 at 22:12 -0500, Matt Domsch wrote:
> On Tue, Jul 19, 2005 at 06:07:41PM -0600, Moore, Eric Dean wrote:
[...]
> > What you illustrated above is not going to work.
> > If your doing #ifndef around a function, such as scsi_device_online, it's
> > not going to compile
> > when scsi_device_online is already implemented in the kernel tree.
> > The routine scsi_device_online is a function, not a define.  For a define
> > this would work.
> 
> Sure it does, function names are defined symbols.

Defined for the preprocessor or the pure C-compiler or both of them?

Bernd
-- 
Firmix Software GmbH   http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
  Embedded Linux Development and Services

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html