lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 28 Jul 2009 16:53:54 +0200 From: Sascha Hauer <s.hauer@...gutronix.de> To: Oliver Hartkopp <socketcan@...tkopp.net> Cc: Socketcan-core@...ts.berlios.de, Linux Netdev List <netdev@...r.kernel.org> Subject: Re: [PATCH V2] CAN: Add Flexcan CAN controller driver On Tue, Jul 28, 2009 at 04:48:34PM +0200, Oliver Hartkopp wrote: > Sascha Hauer wrote: > > On Tue, Jul 28, 2009 at 04:12:10PM +0200, Oliver Hartkopp wrote: > >> Oliver Hartkopp wrote: > >>> Sascha Hauer wrote: > >>>>>> + > >>>>>> + if (frame->can_id & CAN_RTR_FLAG) > >>>>>> + dlc |= MB_CNT_RTR; > >>>>>> + > >>>>>> + writel(dlc, ®s->cantxfg[TX_BUF_ID].can_dlc); > >>>>>> + writel(can_id, ®s->cantxfg[TX_BUF_ID].can_id); > >> Are you sure, that this is correct? > > > > Yes, I am sure, at least on my hardware. > > I looked into the writel() macro which does a cpu_to_le32() to the value - > sorry that i did not check this before ... > > > > >> Indeed i wonder, if it would make sense to skip the entire struct flexcan_mb > >> approach and fiddle byte-by-byte inside the registers ... > > > > You'll have to to 32 bit accesses to get it right on little and big > > endian. > > > > what we can do is: > > > > writel(can_data[0] << 24 | can_data[1] << 16 | can_data[2] << 8 | can_data[3], > > msg_buf + 0x8); > > This looks easier to understand and makes things clear, when you look into the > specification. Ok, I'll change it like this. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists