summaryrefslogtreecommitdiff
path: root/drivers/net/can/bfin_can.c
AgeCommit message (Collapse)Author
2011-06-27can: bfin_can: auto-calculate accessor sizesMike Frysinger
Since we have a struct that defines the sizes of the registers, we don't need to explicitly use the 16bit read/write helpers. Let the code figure out which size access to make based on the size of the C type. There should be no functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-27can: bfin_can: simplify xmit id1 setupMike Frysinger
If we look closely, the 4 writes to TRANSMIT_CHL.id1 can be collapsed down into much simpler code. So do just that. This also fixes a build failure due to the I/O macros no longer getting pulled in. Their minor (and accidental) usage here gets dropped as part of the unification. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-10net: trans_start cleanupsEric Dumazet
Now that core network takes care of trans_start updates, dont do it in drivers themselves, if possible. Drivers can avoid one cache miss (on dev->trans_start) in their start_xmit() handler. Exceptions are NETIF_F_LLTX drivers Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-13Fix some #includes in CAN drivers (rebased for net-next-2.6)Hans J. Koch
In the current implementation, CAN drivers need to #include <linux/can.h> _before_ they #include <linux/can/dev.h>, which is both ugly and unnecessary. Fix this by including <linux/can.h> in <linux/can/dev.h> and remove the #include <linux/can.h> lines from drivers. Signed-off-by: Hans J. Koch <hjk@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-22can: bfin_can: switch to common Blackfin can headerMike Frysinger
The MMR bits are being moved to this header, so include it. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-08can: fix bfin_can build error after alloc_candev() changeBarry Song
Looks like commit a6e4bc530403 didn't include updates to drivers so the Blackfin CAN driver fails to build now. Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-15can: Proper ctrlmode handling for CAN devicesChristian Pellegrin
This patch adds error checking of ctrlmode values for CAN devices. As an example all availabe bits are implemented in the mcp251x driver. Signed-off-by: Christian Pellegrin <chripell@fsfe.org> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-12can: Unify droping of invalid tx skbs and netdev statsOliver Hartkopp
To prevent the CAN drivers to operate on invalid socketbuffers the skbs are now checked and silently dropped at the xmit-function consistently. Also the netdev stats are consistently using the CAN data length code (dlc) for [rx|tx]_bytes now. Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-13can: Fix data length code handling in rx pathOliver Hartkopp
A valid CAN dataframe can have a data length code (DLC) of 0 .. 8 data bytes. When reading the CAN controllers register the 4-bit value may contain values from 0 .. 15 which may exceed the reserved space in the socket buffer! The ISO 11898-1 Chapter 8.4.2.3 (DLC field) says that register values > 8 should be reduced to 8 without any error reporting or frame drop. This patch introduces a new helper macro to cast a given 4-bit data length code (dlc) to __u8 and ensure the DLC value to be max. 8 bytes. The different handlings in the rx path of the CAN netdevice drivers are fixed. Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-11can: add the driver for Analog Devices Blackfin on-chip CAN controllersBarry Song
Signed-off-by: Barry Song <21cnbao@gmail.com> Signed-off-by: H.J. Oertel <oe@port.de> Signed-off-by: Wolfgang Grandegger <wg@grandegger.de> Signed-off-by: David S. Miller <davem@davemloft.net>