+ int cmd;
+ sCAN_CARD *chipext = (sCAN_CARD *)chip->chip_data;
+ __u16 *ptr16 = (__u16*)chipext->rxBufPtr;
+ __u16 u;
+ unsigned long timestamp=0;
+ unsigned long cobid;
+ int i;
+ int len;
+
+ #if 0
+ if(obj->tx_slot){
+ /* Do local transmitted message distribution if enabled */
+ if (processlocal){
+ obj->tx_slot->msg.flags |= MSG_LOCAL;
+ canque_filter_msg2edges(obj->qends, &obj->tx_slot->msg);
+ }
+ /* Free transmitted slot */
+ canque_free_outslot(obj->qends, obj->tx_qedge, obj->tx_slot);
+ obj->tx_slot=NULL;
+ }
+ #endif
+
+ if ( chipext->asyncTxBufSize==0 ) {
+ canque_notify_inends(obj->tx_qedge, CANQUEUE_NOTIFY_ERRTX_PREP);
+ return; /* No asynchronous queue configured */
+ }
+
+ do {
+ ptr16 = (__u16*)chipext->asyncTxBufPtr;
+ if(readw(ptr16) & CL2_MESSAGE_VALID)
+ return; /* No free space in asynchronous Tx queue */
+
+ cmd=canque_test_outslot(obj->qends, &obj->tx_qedge, &obj->tx_slot);
+ if(cmd<0)
+ return; /* No more messages to send */
+
+
+ cobid = obj->tx_slot->msg.id;
+
+ if ( (obj->tx_slot->msg.flags & MSG_EXT) ) { /* 2.0B frame */
+ cobid <<= 3;
+ } else { /* 2.0A frame */
+ cobid <<= 5+16;
+ }
+ ptr16++;
+ u = ((cobid>>16) & 0x00FF ) + (cobid & 0xFF00);
+ writew(u,ptr16++);
+
+ len = obj->tx_slot->msg.length;
+ if(len > CAN_MSG_LENGTH)
+ len = CAN_MSG_LENGTH;
+ u = (len << 12) | (cobid & 0x00FF);
+
+ if ( !(obj->tx_slot->msg.flags & MSG_RTR) )
+ u |= CL2_REMOTE_FRAME<<8;
+ if ( obj->tx_slot->msg.flags & MSG_EXT )
+ u |= CL2_EXT_FRAME<<8;
+
+ writew(u,ptr16++);
+
+ for ( i = 0; i < len-1; ) {
+ u = obj->tx_slot->msg.data[i++];
+ u |= ((__u16)obj->tx_slot->msg.data[i]<<8); i++;
+ writew(u,ptr16++);
+ }
+ if(i == len) {
+ writew(timestamp,ptr16);
+ } else {
+ u = obj->tx_slot->msg.data[i++];
+ u |= ((timestamp & 0x00FF)<<8);
+ writew(u,ptr16++);
+ writew(timestamp & 0x00FF, ptr16);
+ }
+
+ u = ((cobid>>16) & 0xFF00) | CL2_MESSAGE_VALID;
+ writew(u,(__u16*)chipext->asyncTxBufPtr);
+
+ if ( (chipext->asyncTxBufBase + chipext->asyncTxBufSize*16) <=
+ (chipext->asyncTxBufPtr += 16) ) {
+ chipext->asyncTxBufPtr = chipext->asyncTxBufBase;
+ }
+
+
+ /* Do local transmitted message distribution if enabled. */
+ /* This code should not be called directly there, because it breaks strict
+ behavior of queues if O_SYNC is set. */
+ if (processlocal){
+ obj->tx_slot->msg.flags |= MSG_LOCAL;
+ canque_filter_msg2edges(obj->qends, &obj->tx_slot->msg);
+ }
+ /* Free transmitted slot */
+ canque_free_outslot(obj->qends, obj->tx_qedge, obj->tx_slot);
+ obj->tx_slot=NULL;
+
+ }while(1);
+
+ return;
+
+}
+
+void unican_irq_sync_activities(struct chip_t *chip, struct msgobj_t *obj)
+{
+ while(!can_msgobj_test_and_set_fl(obj,TX_LOCK)) {
+
+ if(can_msgobj_test_and_clear_fl(obj,TX_REQUEST)) {
+ unican_irq_write_handler(chip, obj);
+ }
+
+ /*if(can_msgobj_test_and_clear_fl(obj,FILTCH_REQUEST)) {
+ unican_irq_update_filter(chip, obj);
+ }*/