bhupesh.sharma wrote: > > >> There is CCAN support by the old Socket-CAN drivers tree, which does not >> use the CAN device drivers interface. Nice to hear that you are trying >> to port the CCAN driver. > Yes. I am using the same as reference ;) > >>> Similar to Hynix, my SOC has 2 CAN IPs and I intend to use the same >>> driver >>> to handle both the IPs. >> Could you be more precise? What SOC are you speaking about? > This is a SOC being developed by my company. It is still not officially > launced. I hope that most of the linux device drivers we are developing for > this SOC, become available as open-source code ones. > >>> Now, what is the significance of stopping the `netif_queue` when the >>> priv->tx_object becomes 5. >>> This must be a limitation seen by the developer of this driver in the >>> CCAN >>> IP in Hynix. > >> The netif_stop_queue() tells the network layer to stop sending packets >> via the hard_start_xmit() function. It's usually called when no more >> hardware objects/buffers are available/free for transmission. See: > >> http://lxr.linux.no/#linux+v2.6.31/include/linux/netdevice.h#L1305 > Many thanks for the reference. Actually I know the usage of > `netif_stop_queue`, as I last developed a ethernet driver for RealTek > switch. Actually, I am wondering if there is a limitation at the C_CAN IP > level that one can program *at most* 5 Tx objects at a time through > hard_start_xmit() function. > > Infact, when I see the reference C_CAN device driver (char based) from Bosch > site(http://www.semiconductors.bosch.de/en/20/can/products/ccan.asp) "Linux > CAN Driver for HMS30C7202 (C_CAN)", I see the following interesting points: > > Driver > ====== > ssize_t can_write( struct file *filp, > const char *buffer, > size_t length, > loff_t *offset ) > { > /* Max 8 messages at the time is allowed */ > if (length > 8 * sizeof( struct canmsg_t )) { > CANMSG("Trying to write more than is supported."); > return -1; > } > .. > } > > Application > ============ > /* > * Sends one or more messages through given device. > */ > int send_messages ( struct can_device_t * can_device ) > { > .. > printf(" Length : "); fflush( NULL); > scanf("%d", &length); > if (length < 0) > length = 0; > if (length > 8) > length = 8; > canmsg.length = length; > .. > } > > It also implements a bounday of 8 transmit messages that can be written to. > This seems similar to C_CAN in SocketCAN SVN: > > if (priv->tx_object > 5) > netif_stop_queue(dev); > > Since the Bosch user manual for C_CAN does not speak of any such limitation, > I am wondering why all drivers are setting such boundaries on no. of Tx > objects that can be xmitted. This may explain why I get issue when I use > `cansend` for multiple frames.
I had a quick look to the manual. The C_CAN has 32 message object which could be setup for TX *or* RX. They can also be concatenated to form a FIFO buffer. A closer look to the ccan.c code should make clear what's used. Wolfgang. _______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
