Lines Matching refs:es
821 const struct kvaser_usb_error_summary *es, in kvaser_usb_rx_error_update_can_state() argument
828 netdev_dbg(priv->netdev, "Error status: 0x%02x\n", es->status); in kvaser_usb_rx_error_update_can_state()
832 if (es->status & (M16C_STATE_BUS_OFF | M16C_STATE_BUS_RESET)) in kvaser_usb_rx_error_update_can_state()
834 else if (es->status & M16C_STATE_BUS_PASSIVE) in kvaser_usb_rx_error_update_can_state()
836 else if (es->status & M16C_STATE_BUS_ERROR) { in kvaser_usb_rx_error_update_can_state()
839 if ((es->txerr >= 128) || (es->rxerr >= 128)) in kvaser_usb_rx_error_update_can_state()
841 else if ((es->txerr >= 96) || (es->rxerr >= 96)) in kvaser_usb_rx_error_update_can_state()
848 if (!es->status) in kvaser_usb_rx_error_update_can_state()
852 tx_state = (es->txerr >= es->rxerr) ? new_state : 0; in kvaser_usb_rx_error_update_can_state()
853 rx_state = (es->txerr <= es->rxerr) ? new_state : 0; in kvaser_usb_rx_error_update_can_state()
866 if (es->leaf.error_factor) { in kvaser_usb_rx_error_update_can_state()
872 if (es->usbcan.error_state & USBCAN_ERROR_STATE_TX_ERROR) in kvaser_usb_rx_error_update_can_state()
874 if (es->usbcan.error_state & USBCAN_ERROR_STATE_RX_ERROR) in kvaser_usb_rx_error_update_can_state()
876 if (es->usbcan.error_state & USBCAN_ERROR_STATE_BUSERROR) { in kvaser_usb_rx_error_update_can_state()
882 priv->bec.txerr = es->txerr; in kvaser_usb_rx_error_update_can_state()
883 priv->bec.rxerr = es->rxerr; in kvaser_usb_rx_error_update_can_state()
887 const struct kvaser_usb_error_summary *es) in kvaser_usb_rx_error() argument
895 if (es->channel >= dev->nchannels) { in kvaser_usb_rx_error()
897 "Invalid channel number (%d)\n", es->channel); in kvaser_usb_rx_error()
901 priv = dev->nets[es->channel]; in kvaser_usb_rx_error()
915 kvaser_usb_rx_error_update_can_state(priv, es, &tmp_cf); in kvaser_usb_rx_error()
926 if (es->status & in kvaser_usb_rx_error()
943 if (es->leaf.error_factor) { in kvaser_usb_rx_error()
946 if (es->leaf.error_factor & M16C_EF_ACKE) in kvaser_usb_rx_error()
948 if (es->leaf.error_factor & M16C_EF_CRCE) in kvaser_usb_rx_error()
951 if (es->leaf.error_factor & M16C_EF_FORME) in kvaser_usb_rx_error()
953 if (es->leaf.error_factor & M16C_EF_STFE) in kvaser_usb_rx_error()
955 if (es->leaf.error_factor & M16C_EF_BITE0) in kvaser_usb_rx_error()
957 if (es->leaf.error_factor & M16C_EF_BITE1) in kvaser_usb_rx_error()
959 if (es->leaf.error_factor & M16C_EF_TRE) in kvaser_usb_rx_error()
964 if (es->usbcan.error_state & USBCAN_ERROR_STATE_BUSERROR) { in kvaser_usb_rx_error()
970 cf->data[6] = es->txerr; in kvaser_usb_rx_error()
971 cf->data[7] = es->rxerr; in kvaser_usb_rx_error()
982 struct kvaser_usb_error_summary *es) in kvaser_usbcan_conditionally_rx_error() argument
988 channel = es->channel; in kvaser_usbcan_conditionally_rx_error()
998 if (es->txerr != priv->bec.txerr) { in kvaser_usbcan_conditionally_rx_error()
999 es->usbcan.error_state |= USBCAN_ERROR_STATE_TX_ERROR; in kvaser_usbcan_conditionally_rx_error()
1002 if (es->rxerr != priv->bec.rxerr) { in kvaser_usbcan_conditionally_rx_error()
1003 es->usbcan.error_state |= USBCAN_ERROR_STATE_RX_ERROR; in kvaser_usbcan_conditionally_rx_error()
1006 if ((es->status & M16C_STATE_BUS_ERROR) && in kvaser_usbcan_conditionally_rx_error()
1007 !(es->usbcan.other_ch_status & M16C_STATE_BUS_ERROR)) { in kvaser_usbcan_conditionally_rx_error()
1008 es->usbcan.error_state |= USBCAN_ERROR_STATE_BUSERROR; in kvaser_usbcan_conditionally_rx_error()
1013 kvaser_usb_rx_error(dev, es); in kvaser_usbcan_conditionally_rx_error()
1019 struct kvaser_usb_error_summary es = { }; in kvaser_usbcan_rx_error() local
1024 es.channel = msg->u.usbcan.chip_state_event.channel; in kvaser_usbcan_rx_error()
1025 es.status = msg->u.usbcan.chip_state_event.status; in kvaser_usbcan_rx_error()
1026 es.txerr = msg->u.usbcan.chip_state_event.tx_errors_count; in kvaser_usbcan_rx_error()
1027 es.rxerr = msg->u.usbcan.chip_state_event.rx_errors_count; in kvaser_usbcan_rx_error()
1028 kvaser_usbcan_conditionally_rx_error(dev, &es); in kvaser_usbcan_rx_error()
1032 es.channel = 0; in kvaser_usbcan_rx_error()
1033 es.status = msg->u.usbcan.error_event.status_ch0; in kvaser_usbcan_rx_error()
1034 es.txerr = msg->u.usbcan.error_event.tx_errors_count_ch0; in kvaser_usbcan_rx_error()
1035 es.rxerr = msg->u.usbcan.error_event.rx_errors_count_ch0; in kvaser_usbcan_rx_error()
1036 es.usbcan.other_ch_status = in kvaser_usbcan_rx_error()
1038 kvaser_usbcan_conditionally_rx_error(dev, &es); in kvaser_usbcan_rx_error()
1044 es.channel = 1; in kvaser_usbcan_rx_error()
1045 es.status = msg->u.usbcan.error_event.status_ch1; in kvaser_usbcan_rx_error()
1046 es.txerr = msg->u.usbcan.error_event.tx_errors_count_ch1; in kvaser_usbcan_rx_error()
1047 es.rxerr = msg->u.usbcan.error_event.rx_errors_count_ch1; in kvaser_usbcan_rx_error()
1048 es.usbcan.other_ch_status = in kvaser_usbcan_rx_error()
1050 kvaser_usbcan_conditionally_rx_error(dev, &es); in kvaser_usbcan_rx_error()
1063 struct kvaser_usb_error_summary es = { }; in kvaser_leaf_rx_error() local
1067 es.channel = msg->u.leaf.error_event.channel; in kvaser_leaf_rx_error()
1068 es.status = msg->u.leaf.error_event.status; in kvaser_leaf_rx_error()
1069 es.txerr = msg->u.leaf.error_event.tx_errors_count; in kvaser_leaf_rx_error()
1070 es.rxerr = msg->u.leaf.error_event.rx_errors_count; in kvaser_leaf_rx_error()
1071 es.leaf.error_factor = msg->u.leaf.error_event.error_factor; in kvaser_leaf_rx_error()
1074 es.channel = msg->u.leaf.log_message.channel; in kvaser_leaf_rx_error()
1075 es.status = msg->u.leaf.log_message.data[0]; in kvaser_leaf_rx_error()
1076 es.txerr = msg->u.leaf.log_message.data[2]; in kvaser_leaf_rx_error()
1077 es.rxerr = msg->u.leaf.log_message.data[3]; in kvaser_leaf_rx_error()
1078 es.leaf.error_factor = msg->u.leaf.log_message.data[1]; in kvaser_leaf_rx_error()
1081 es.channel = msg->u.leaf.chip_state_event.channel; in kvaser_leaf_rx_error()
1082 es.status = msg->u.leaf.chip_state_event.status; in kvaser_leaf_rx_error()
1083 es.txerr = msg->u.leaf.chip_state_event.tx_errors_count; in kvaser_leaf_rx_error()
1084 es.rxerr = msg->u.leaf.chip_state_event.rx_errors_count; in kvaser_leaf_rx_error()
1085 es.leaf.error_factor = 0; in kvaser_leaf_rx_error()
1093 kvaser_usb_rx_error(dev, &es); in kvaser_leaf_rx_error()