public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Jing Huang <huangj@brocade.com>
Cc: James.Bottomley@hansenpartnership.com,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	rvadivel@brocade.com, vravindr@brocade.com
Subject: Re: [PATCH 2/14] bfa: Brocade BFA FC SCSI driver (bfa part1)
Date: Fri, 21 Aug 2009 19:35:44 +0200	[thread overview]
Message-ID: <200908211935.46316.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <200908200659.n7K6xqMZ006536@swe57.brocade.com>

[-- Attachment #1: Type: Text/Plain, Size: 1548 bytes --]

Jing Huang wrote:
> From: Jing Huang <huangj@brocade.com>
>
> This patch contains code to access Brocade Fibre channel HBA
> firmware/hardware, part-1
>
> +/*
> + * Copyright (c)  2005-2008 Brocade Communications Systems, Inc.
> + * All rights reserved
> + * www.brocade.com

Shouldn't that be 2009?

> +char *
> +wwn2str(char *buf, int bufsize, u64 wwn)
> +{
> +	char *ptr;
> +	union {
> +	wwn_t           wwn;
> +	u8         byte[sizeof(wwn_t)];
> +	} w;
> +	int i = sizeof(wwn_t);
> +
> +	ptr = buf + bufsize;
> +	*--ptr = '\0';
> +	bufsize--;
> +
> +	w.wwn = wwn;
> +	while (i > 0) {
> +		i--;
> +		*--ptr = n2b(w.byte[i] & 0x0f);
> +		*--ptr = n2b((w.byte[i] >> 4) & 0x0f);
> +		if (i > 0)
> +			*--ptr = ':';
> +	}
> +
> +	return ptr;
> +}

I searched for 20 minutes and found nothing. Is there really no standard 
function to printf a WWN? I mean, every FC driver needs this, no?

fnic:
-"%llx", wwn

ipr:
-"%08X%08X", be32_to_cpu(wwid[0]), be32_to_cpu(wwid[1]) 

lpfc:
-"%02x%02x%02x%02x%02x%02x%02x%02x", wwn[0], wwn[1], ...
-"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", wwn[0], wwn[1], ...
-"0x%llx", cfg_soft_wwnn

qla2xxx:
-like lpfc, version 1. Harder to find as there it is called port_name and 
node_name instead of wwpn or wwnn or wwn

Is there really nothing like this? Should be an easy job to write one and 
convert all existing drivers over to use this, no? Would also add the benefit 
as that all drivers would print that in the same way. 

Ei-printk("%WWN", wwn)-ke

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2009-08-21 17:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20  6:59 [PATCH 2/14] bfa: Brocade BFA FC SCSI driver (bfa part1) Jing Huang
2009-08-21 17:35 ` Rolf Eike Beer [this message]
2009-08-22  1:58   ` Jing Huang
  -- strict thread matches above, loose matches on Subject: below --
2009-08-28  7:57 Jing Huang

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=200908211935.46316.eike-kernel@sf-tec.de \
    --to=eike-kernel@sf-tec.de \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=huangj@brocade.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rvadivel@brocade.com \
    --cc=vravindr@brocade.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox