|
@@ -96,7 +96,7 @@ struct bcm_op {
|
|
canid_t can_id;
|
|
canid_t can_id;
|
|
u32 flags;
|
|
u32 flags;
|
|
unsigned long frames_abs, frames_filtered;
|
|
unsigned long frames_abs, frames_filtered;
|
|
- struct timeval ival1, ival2;
|
|
|
|
|
|
+ struct bcm_timeval ival1, ival2;
|
|
struct hrtimer timer, thrtimer;
|
|
struct hrtimer timer, thrtimer;
|
|
struct tasklet_struct tsklet, thrtsklet;
|
|
struct tasklet_struct tsklet, thrtsklet;
|
|
ktime_t rx_stamp, kt_ival1, kt_ival2, kt_lastmsg;
|
|
ktime_t rx_stamp, kt_ival1, kt_ival2, kt_lastmsg;
|
|
@@ -131,6 +131,11 @@ static inline struct bcm_sock *bcm_sk(const struct sock *sk)
|
|
return (struct bcm_sock *)sk;
|
|
return (struct bcm_sock *)sk;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline ktime_t bcm_timeval_to_ktime(struct bcm_timeval tv)
|
|
|
|
+{
|
|
|
|
+ return ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC);
|
|
|
|
+}
|
|
|
|
+
|
|
#define CFSIZ sizeof(struct can_frame)
|
|
#define CFSIZ sizeof(struct can_frame)
|
|
#define OPSIZ sizeof(struct bcm_op)
|
|
#define OPSIZ sizeof(struct bcm_op)
|
|
#define MHSIZ sizeof(struct bcm_msg_head)
|
|
#define MHSIZ sizeof(struct bcm_msg_head)
|
|
@@ -953,8 +958,8 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
|
|
op->count = msg_head->count;
|
|
op->count = msg_head->count;
|
|
op->ival1 = msg_head->ival1;
|
|
op->ival1 = msg_head->ival1;
|
|
op->ival2 = msg_head->ival2;
|
|
op->ival2 = msg_head->ival2;
|
|
- op->kt_ival1 = timeval_to_ktime(msg_head->ival1);
|
|
|
|
- op->kt_ival2 = timeval_to_ktime(msg_head->ival2);
|
|
|
|
|
|
+ op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1);
|
|
|
|
+ op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2);
|
|
|
|
|
|
/* disable an active timer due to zero values? */
|
|
/* disable an active timer due to zero values? */
|
|
if (!op->kt_ival1.tv64 && !op->kt_ival2.tv64)
|
|
if (!op->kt_ival1.tv64 && !op->kt_ival2.tv64)
|
|
@@ -1134,8 +1139,8 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
|
|
/* set timer value */
|
|
/* set timer value */
|
|
op->ival1 = msg_head->ival1;
|
|
op->ival1 = msg_head->ival1;
|
|
op->ival2 = msg_head->ival2;
|
|
op->ival2 = msg_head->ival2;
|
|
- op->kt_ival1 = timeval_to_ktime(msg_head->ival1);
|
|
|
|
- op->kt_ival2 = timeval_to_ktime(msg_head->ival2);
|
|
|
|
|
|
+ op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1);
|
|
|
|
+ op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2);
|
|
|
|
|
|
/* disable an active timer due to zero value? */
|
|
/* disable an active timer due to zero value? */
|
|
if (!op->kt_ival1.tv64)
|
|
if (!op->kt_ival1.tv64)
|