All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: John Soni Jose <sony.john-n@Emulex.Com>
Cc: linux-scsi@vger.kernel.org,
	Jayamohan Kallickal <jayamohan.kallickal@Emulex.Com>
Subject: Re: [PATCH v2 05/19] be2iscsi: Display driver name and version in device attribute
Date: Wed, 24 Oct 2012 02:00:13 -0500	[thread overview]
Message-ID: <508791FD.8060004@cs.wisc.edu> (raw)
In-Reply-To: <9fdbe712-1e34-4864-949e-f570426e0b09@CMEXHTCAS2.ad.emulex.com>

On 10/19/2012 06:12 PM, John Soni Jose wrote:
> Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> ---
>  drivers/scsi/be2iscsi/be_main.c |    2 ++
>  drivers/scsi/be2iscsi/be_mgmt.c |   16 ++++++++++++++++
>  drivers/scsi/be2iscsi/be_mgmt.h |    3 +++
>  3 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index 2d1bbb8..bd0f49f 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -153,8 +153,10 @@ BEISCSI_RW_ATTR(log_enable, 0x00,
>  		"\t\t\t\tIO Path Events		: 0x10\n"
>  		"\t\t\t\tConfiguration Path	: 0x20\n");
>  
> +DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL);
>  struct device_attribute *beiscsi_attrs[] = {
>  	&dev_attr_beiscsi_log_enable,
> +	&dev_attr_beiscsi_drvr_ver,
>  	NULL,
>  };
>  
> diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
> index aab5dd3..1ec1db3 100644
> --- a/drivers/scsi/be2iscsi/be_mgmt.c
> +++ b/drivers/scsi/be2iscsi/be_mgmt.c
> @@ -1136,3 +1136,19 @@ int mgmt_set_vlan(struct beiscsi_hba *phba,
>  	free_mcc_tag(&phba->ctrl, tag);
>  	return 0;
>  }
> +
> +/**
> + * beiscsi_drvr_ver_disp()- Display the driver Name and Version
> + * @dev: ptr to device not used.
> + * @attr: device attribute, not used.
> + * @buf: contains formatted text driver name and version
> + *
> + * return
> + * size of the formatted string
> + **/
> +ssize_t
> +beiscsi_drvr_ver_disp(struct device *dev, struct device_attribute *attr,
> +		       char *buf)
> +{
> +	return snprintf(buf, PAGE_SIZE, BE_NAME "\n");
> +}


It seems this should just be some sort of standard attr. All drivers
should export the name and version in some standard place to make it
easy for users and tools. Maybe until that day this is ok?


      reply	other threads:[~2012-10-24  7:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19 23:12 [PATCH v2 05/19] be2iscsi: Display driver name and version in device attribute John Soni Jose
2012-10-24  7:00 ` Mike Christie [this message]

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=508791FD.8060004@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=jayamohan.kallickal@Emulex.Com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sony.john-n@Emulex.Com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.