public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: "Jean-François Dagenais" <jeff.dagenais@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: Re: [PATCH V2] w1: ds2408: add magic sequence to disable P0 test mode
Date: Fri, 10 May 2013 18:15:27 +0400	[thread overview]
Message-ID: <20130510141526.GA6755@ioremap.net> (raw)
In-Reply-To: <1A322F9E-F2A7-42E6-8C37-8A5C3F2E28FD@gmail.com>

On Thu, May 09, 2013 at 03:33:23PM -0400, Jean-François Dagenais (jeff.dagenais@gmail.com) wrote:
> To be honest, I didn't really thought about it that much, I just copy pasted that from Evgeniy Polyakov's hunk at drivers/w1/w1_io.c, function w1_reset_select_slave(struct w1_slave *sl) exept I changed the MATCH_ROM with magic 0x96 and appended magic 0x3C. I have tested it only on the available platform I have which is x86. I agree it looks dodgy. Do you have an alternative? You are certainly more familiar with the kernel's fancy bit and endian tools than I am. I'd be willing to test prior to sending V3.
> 
> 
> struct w1_reg_num
> {
> #if defined(__LITTLE_ENDIAN_BITFIELD)
> 	__u64	family:8,
> 		id:48,
> 		crc:8;
> #elif defined(__BIG_ENDIAN_BITFIELD)
> 	__u64	crc:8,
> 		id:48,
> 		family:8;
> #else
> #error "Please fix <asm/byteorder.h>"
> #endif
> };
> 
> On the wire, the family byte should be sent first, then the MSB of id, then the rest of id and finally the crc.
> 
> Perhaps Evgeniy can chime in here?

That's transform is only used to cast structure to uint64_t, nothing
fancy. In-memory structure should be ok because of above definition on
every endian.

-- 
	Evgeniy Polyakov

      reply	other threads:[~2013-05-10 14:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07 12:40 Fix ds2408 P0 output not working after power-on Jean-Francois Dagenais
2013-05-07 12:40 ` [PATCH] w1: ds2408: add magic sequence to disable P0 test mode Jean-Francois Dagenais
2013-05-07 14:00   ` [PATCH V2] " Jean-Francois Dagenais
2013-05-09 18:03     ` Andrew Morton
2013-05-09 19:33       ` Jean-François Dagenais
2013-05-10 14:15         ` Evgeniy Polyakov [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=20130510141526.GA6755@ioremap.net \
    --to=zbr@ioremap.net \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=jeff.dagenais@gmail.com \
    --cc=linux-kernel@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