linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] path_id: add handle_scsi_sas
Date: Wed, 07 Jul 2010 10:20:23 +0000	[thread overview]
Message-ID: <4C3454E7.8090103@suse.de> (raw)
In-Reply-To: <1277468902-12862-1-git-send-email-harald@redhat.com>

harald@redhat.com wrote:
> From: Harald Hoyer <harald@redhat.com>
> 
> based on code by Jim Garlick.
> ---
>  extras/path_id/path_id.c |   64 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 63 insertions(+), 1 deletions(-)
> 
> diff --git a/extras/path_id/path_id.c b/extras/path_id/path_id.c
> index dcee378..c3d241b 100644
> --- a/extras/path_id/path_id.c
> +++ b/extras/path_id/path_id.c
> @@ -121,7 +121,69 @@ out:
>  
>  static struct udev_device *handle_scsi_sas(struct udev_device *parent, char **path)
>  {
> -	return NULL;
> +	struct udev *udev  = udev_device_get_udev(parent);
> +	struct udev_device *end_dev;
> +	struct udev_device *sasdev;
> +	struct udev_device *phydev;
> +	struct udev_device *parent_dev;
> +	struct udev_device *child_dev;
> +	char syspath[UTIL_PATH_SIZE], *base;
> +	char phy_path[UTIL_PATH_SIZE];
> +	const char *end_name, *name, *enc, *bay;
> +	const char *port_path;
> +	int scsi_host;
> +	int num_phys = 8;
> +	int i;
> +
> +	parent_dev = parent;
> +	while (1) {
> +		child_dev = parent_dev;
> +		parent_dev = udev_device_get_parent(child_dev);
> +		if (parent_dev = NULL)
> +			return NULL;
> +		name = udev_device_get_sysname(parent_dev);
> +		if (strstr(name, "end_device-")) {
> +			end_dev = parent_dev;
> +			end_name = name;
> +		} else if (sscanf(name, "host%d", &scsi_host)) {
> +			port_path = udev_device_get_syspath(child_dev);
> +			break;
> +		}
> +	}
> +
This is wrong. The whole idea of path_id is that the path traversal is done
in one common loop, from which there are callouts to the individual device
handlers.

So we should be having one sas_end_device_handler and one sas_host handler.

I'll see to come up with an updated version.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

  parent reply	other threads:[~2010-07-07 10:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-25 12:28 [PATCH] path_id: add handle_scsi_sas harald
2010-06-25 13:27 ` harald
2010-06-25 13:29 ` Harald Hoyer
2010-07-07 10:20 ` Hannes Reinecke [this message]
2010-07-07 12:05 ` Kay Sievers

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=4C3454E7.8090103@suse.de \
    --to=hare@suse.de \
    --cc=linux-hotplug@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).