linux-can-next-for-4.1-20150323

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJVD+1xAAoJECte4hHFiupUVD8P/2ymRe2lcNILciuzaErjkDjc
 GvbvsDM2rIPKfxT1ptrn52l9MhvIN/oFwVjSzdBNFKz9GmCnqvwwT+EHpV2CxdIR
 deblAbDAGuzYbDbY7uadOXU2CQWcUw7r7wCgNhIcWs1qd7ndfGVj3eBKFsJsGuvM
 5s2sSP4s7U2xgIk2Ts8RHAGdofL/YVUUqSTOWzUfTJm7rPDTtWLXHMk0e3V8kFN0
 im9yy00gOnMYpuAMfemD7fm6OClO/3L2x5gjVXNMGrf73TivfLMSrCGC3eqN3W9J
 FY7G9502c6cMxNK7eneZE31XCHxpVIOHwGD9C4AWi/b9kHGZjKdQ5HK9KTXAbCLh
 eN8h2hpnlrotS1wDXh0ThGqZYpW7LhzKyZvZ3DSW9WBnwf2NqTdHx2HtIQL6WE8X
 WAZbmUGJhOh+ZZ7hGhIBNHqAT7qz6rprMIKfjio609ZU3vZscnwEUv+8FEKipKFD
 qZTSUE1ZLTczHZg/jMQ208ecE4uD06GsmNzi1kzzHjbaCtGnRhwKfD3yl3V8dn1O
 Zz8n2nJqF+V5F+AWFHgJ6AkM5Na7UOvVhtY/8R7u1D1gn+yQStYjY4y4jxR4JdsU
 8mIUc+1PhJgIggsvbKYP1IzXvMecWtPDDfIkPIXsOaFANF4jN8PTfLXe1ZYGhpCV
 aMuUZk7XUthdJavD0FWZ
 =m6GG
 -----END PGP SIGNATURE-----

Merge tag 'linux-can-next-for-4.1-20150323' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next

Marc Kleine-Budde says:

====================
pull-request: can-next 2015-03-23

this is a pull request of 6 patches for net-next/master.

A patch by Florian Westphal, converts the skb->destructor to use
sock_efree() instead of own destructor. Ahmed S. Darwish's patch
converts the kvaser_usb driver to use unregister_candev(). A patch by
me removes a return from a void function in the m_can driver. Yegor
Yefremov contributes a patch for combined rx/tx LED trigger support. A
sparse warning in the esd_usb2 driver was fixes by Thomas Körper. Ben
Dooks converts the at91_can driver to use endian agnostic IO accessors.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2015-03-23 22:03:43 -04:00
commit e167359be0
8 changed files with 33 additions and 18 deletions

View File

@ -291,13 +291,13 @@ static inline unsigned int get_tx_echo_mb(const struct at91_priv *priv)
static inline u32 at91_read(const struct at91_priv *priv, enum at91_reg reg)
{
return __raw_readl(priv->reg_base + reg);
return readl_relaxed(priv->reg_base + reg);
}
static inline void at91_write(const struct at91_priv *priv, enum at91_reg reg,
u32 value)
{
__raw_writel(value, priv->reg_base + reg);
writel_relaxed(value, priv->reg_base + reg);
}
static inline void set_mb_mode_prio(const struct at91_priv *priv,

View File

@ -30,20 +30,28 @@ void can_led_event(struct net_device *netdev, enum can_led_event event)
case CAN_LED_EVENT_OPEN:
led_trigger_event(priv->tx_led_trig, LED_FULL);
led_trigger_event(priv->rx_led_trig, LED_FULL);
led_trigger_event(priv->rxtx_led_trig, LED_FULL);
break;
case CAN_LED_EVENT_STOP:
led_trigger_event(priv->tx_led_trig, LED_OFF);
led_trigger_event(priv->rx_led_trig, LED_OFF);
led_trigger_event(priv->rxtx_led_trig, LED_OFF);
break;
case CAN_LED_EVENT_TX:
if (led_delay)
if (led_delay) {
led_trigger_blink_oneshot(priv->tx_led_trig,
&led_delay, &led_delay, 1);
led_trigger_blink_oneshot(priv->rxtx_led_trig,
&led_delay, &led_delay, 1);
}
break;
case CAN_LED_EVENT_RX:
if (led_delay)
if (led_delay) {
led_trigger_blink_oneshot(priv->rx_led_trig,
&led_delay, &led_delay, 1);
led_trigger_blink_oneshot(priv->rxtx_led_trig,
&led_delay, &led_delay, 1);
}
break;
}
}
@ -55,6 +63,7 @@ static void can_led_release(struct device *gendev, void *res)
led_trigger_unregister_simple(priv->tx_led_trig);
led_trigger_unregister_simple(priv->rx_led_trig);
led_trigger_unregister_simple(priv->rxtx_led_trig);
}
/* Register CAN LED triggers for a CAN device
@ -76,11 +85,15 @@ void devm_can_led_init(struct net_device *netdev)
"%s-tx", netdev->name);
snprintf(priv->rx_led_trig_name, sizeof(priv->rx_led_trig_name),
"%s-rx", netdev->name);
snprintf(priv->rxtx_led_trig_name, sizeof(priv->rxtx_led_trig_name),
"%s-rxtx", netdev->name);
led_trigger_register_simple(priv->tx_led_trig_name,
&priv->tx_led_trig);
led_trigger_register_simple(priv->rx_led_trig_name,
&priv->rx_led_trig);
led_trigger_register_simple(priv->rxtx_led_trig_name,
&priv->rxtx_led_trig);
devres_add(&netdev->dev, res);
}
@ -97,7 +110,7 @@ static int can_led_notifier(struct notifier_block *nb, unsigned long msg,
if (!priv)
return NOTIFY_DONE;
if (!priv->tx_led_trig || !priv->rx_led_trig)
if (!priv->tx_led_trig || !priv->rx_led_trig || !priv->rxtx_led_trig)
return NOTIFY_DONE;
if (msg == NETDEV_CHANGENAME) {
@ -106,6 +119,9 @@ static int can_led_notifier(struct notifier_block *nb, unsigned long msg,
snprintf(name, sizeof(name), "%s-rx", netdev->name);
led_trigger_rename_static(name, priv->rx_led_trig);
snprintf(name, sizeof(name), "%s-rxtx", netdev->name);
led_trigger_rename_static(name, priv->rxtx_led_trig);
}
return NOTIFY_DONE;

View File

@ -312,8 +312,8 @@ static inline u32 m_can_fifo_read(const struct m_can_priv *priv,
static inline void m_can_fifo_write(const struct m_can_priv *priv,
u32 fpi, unsigned int offset, u32 val)
{
return writel(val, priv->mram_base + priv->mcfg[MRAM_TXB].off +
fpi * TXB_ELEMENT_SIZE + offset);
writel(val, priv->mram_base + priv->mcfg[MRAM_TXB].off +
fpi * TXB_ELEMENT_SIZE + offset);
}
static inline void m_can_config_endisable(const struct m_can_priv *priv,

View File

@ -139,7 +139,7 @@ struct tx_msg {
u8 cmd;
u8 net;
u8 dlc;
__le32 hnd;
u32 hnd; /* opaque handle, not used by device */
__le32 id; /* upper 3 bits contain flags */
u8 data[8];
};
@ -149,7 +149,7 @@ struct tx_done_msg {
u8 cmd;
u8 net;
u8 status;
__le32 hnd;
u32 hnd; /* opaque handle, not used by device */
__le32 ts;
};

View File

@ -1856,7 +1856,7 @@ static void kvaser_usb_remove_interfaces(struct kvaser_usb *dev)
if (!dev->nets[i])
continue;
unregister_netdev(dev->nets[i]->netdev);
unregister_candev(dev->nets[i]->netdev);
}
kvaser_usb_unlink_all_urbs(dev);

View File

@ -61,6 +61,8 @@ struct can_priv {
char tx_led_trig_name[CAN_LED_NAME_SZ];
struct led_trigger *rx_led_trig;
char rx_led_trig_name[CAN_LED_NAME_SZ];
struct led_trigger *rxtx_led_trig;
char rxtx_led_trig_name[CAN_LED_NAME_SZ];
#endif
};

View File

@ -21,8 +21,10 @@ enum can_led_event {
#ifdef CONFIG_CAN_LEDS
/* keep space for interface name + "-tx"/"-rx" suffix and null terminator */
#define CAN_LED_NAME_SZ (IFNAMSIZ + 4)
/* keep space for interface name + "-tx"/"-rx"/"-rxtx"
* suffix and null terminator
*/
#define CAN_LED_NAME_SZ (IFNAMSIZ + 6)
void can_led_event(struct net_device *netdev, enum can_led_event event);
void devm_can_led_init(struct net_device *netdev);

View File

@ -44,16 +44,11 @@ static inline void can_skb_reserve(struct sk_buff *skb)
skb_reserve(skb, sizeof(struct can_skb_priv));
}
static inline void can_skb_destructor(struct sk_buff *skb)
{
sock_put(skb->sk);
}
static inline void can_skb_set_owner(struct sk_buff *skb, struct sock *sk)
{
if (sk) {
sock_hold(sk);
skb->destructor = can_skb_destructor;
skb->destructor = sock_efree;
skb->sk = sk;
}
}