Lines Matching refs:desc

393 	struct ican3_new_desc desc;  in ican3_init_new_host_interface()  local
410 desc.control = DESC_INTERRUPT | DESC_LEN(1); /* I L=1 */ in ican3_init_new_host_interface()
411 desc.pointer = mod->free_page; in ican3_init_new_host_interface()
415 desc.control |= DESC_WRAP; in ican3_init_new_host_interface()
417 memcpy_toio(dst, &desc, sizeof(desc)); in ican3_init_new_host_interface()
418 dst += sizeof(desc); in ican3_init_new_host_interface()
431 desc.control = DESC_VALID | DESC_LEN(1); /* V L=1 */ in ican3_init_new_host_interface()
432 desc.pointer = mod->free_page; in ican3_init_new_host_interface()
436 desc.control |= DESC_WRAP; in ican3_init_new_host_interface()
438 memcpy_toio(dst, &desc, sizeof(desc)); in ican3_init_new_host_interface()
439 dst += sizeof(desc); in ican3_init_new_host_interface()
448 desc.control = DESC_VALID | DESC_WRAP | DESC_LEN(1); /* VW L=1 */ in ican3_init_new_host_interface()
449 desc.pointer = mod->free_page; in ican3_init_new_host_interface()
450 memcpy_toio(dst, &desc, sizeof(desc)); in ican3_init_new_host_interface()
458 desc.control = DESC_VALID | DESC_WRAP | DESC_LEN(1); /* VW L=1 */ in ican3_init_new_host_interface()
459 desc.pointer = mod->free_page; in ican3_init_new_host_interface()
460 memcpy_toio(dst, &desc, sizeof(desc)); in ican3_init_new_host_interface()
472 struct ican3_fast_desc desc; in ican3_init_fast_host_interface() local
485 memset(&desc, 0, sizeof(desc)); in ican3_init_fast_host_interface()
486 desc.control = 0x00; in ican3_init_fast_host_interface()
487 desc.command = 1; in ican3_init_fast_host_interface()
495 desc.control |= DESC_WRAP; in ican3_init_fast_host_interface()
502 memcpy_toio(dst, &desc, sizeof(desc)); in ican3_init_fast_host_interface()
503 addr += sizeof(desc); in ican3_init_fast_host_interface()
521 memset(&desc, 0, sizeof(desc)); in ican3_init_fast_host_interface()
522 desc.control = DESC_VALID; in ican3_init_fast_host_interface()
523 desc.command = 1; in ican3_init_fast_host_interface()
531 desc.control |= DESC_WRAP; in ican3_init_fast_host_interface()
538 memcpy_toio(dst, &desc, sizeof(desc)); in ican3_init_fast_host_interface()
539 addr += sizeof(desc); in ican3_init_fast_host_interface()
560 struct ican3_new_desc desc; in ican3_new_send_msg() local
561 void __iomem *desc_addr = mod->dpm + (mod->tx_num * sizeof(desc)); in ican3_new_send_msg()
565 memcpy_fromio(&desc, desc_addr, sizeof(desc)); in ican3_new_send_msg()
567 if (!(desc.control & DESC_VALID)) { in ican3_new_send_msg()
573 ican3_set_page(mod, desc.pointer); in ican3_new_send_msg()
578 desc.control ^= DESC_VALID; in ican3_new_send_msg()
579 memcpy_toio(desc_addr, &desc, sizeof(desc)); in ican3_new_send_msg()
582 mod->tx_num = (desc.control & DESC_WRAP) ? 0 : (mod->tx_num + 1); in ican3_new_send_msg()
591 struct ican3_new_desc desc; in ican3_new_recv_msg() local
592 void __iomem *desc_addr = mod->dpm + (mod->rx_num * sizeof(desc)); in ican3_new_recv_msg()
596 memcpy_fromio(&desc, desc_addr, sizeof(desc)); in ican3_new_recv_msg()
598 if (!(desc.control & DESC_VALID)) { in ican3_new_recv_msg()
604 ican3_set_page(mod, desc.pointer); in ican3_new_recv_msg()
609 desc.control ^= DESC_VALID; in ican3_new_recv_msg()
610 memcpy_toio(desc_addr, &desc, sizeof(desc)); in ican3_new_recv_msg()
613 mod->rx_num = (desc.control & DESC_WRAP) ? 0 : (mod->rx_num + 1); in ican3_new_recv_msg()
911 struct ican3_fast_desc *desc, in ican3_to_can_frame() argument
914 if ((desc->command & ICAN3_CAN_TYPE_MASK) == ICAN3_CAN_TYPE_SFF) { in ican3_to_can_frame()
915 if (desc->data[1] & ICAN3_SFF_RTR) in ican3_to_can_frame()
918 cf->can_id |= desc->data[0] << 3; in ican3_to_can_frame()
919 cf->can_id |= (desc->data[1] & 0xe0) >> 5; in ican3_to_can_frame()
920 cf->len = can_cc_dlc2len(desc->data[1] & ICAN3_CAN_DLC_MASK); in ican3_to_can_frame()
921 memcpy(cf->data, &desc->data[2], cf->len); in ican3_to_can_frame()
923 cf->len = can_cc_dlc2len(desc->data[0] & ICAN3_CAN_DLC_MASK); in ican3_to_can_frame()
924 if (desc->data[0] & ICAN3_EFF_RTR) in ican3_to_can_frame()
927 if (desc->data[0] & ICAN3_EFF) { in ican3_to_can_frame()
929 cf->can_id |= desc->data[2] << 21; /* 28-21 */ in ican3_to_can_frame()
930 cf->can_id |= desc->data[3] << 13; /* 20-13 */ in ican3_to_can_frame()
931 cf->can_id |= desc->data[4] << 5; /* 12-5 */ in ican3_to_can_frame()
932 cf->can_id |= (desc->data[5] & 0xf8) >> 3; in ican3_to_can_frame()
934 cf->can_id |= desc->data[2] << 3; /* 10-3 */ in ican3_to_can_frame()
935 cf->can_id |= desc->data[3] >> 5; /* 2-0 */ in ican3_to_can_frame()
938 memcpy(cf->data, &desc->data[6], cf->len); in ican3_to_can_frame()
944 struct ican3_fast_desc *desc) in can_frame_to_ican3() argument
947 memset(desc->data, 0, sizeof(desc->data)); in can_frame_to_ican3()
950 desc->command = ICAN3_CAN_TYPE_EFF; in can_frame_to_ican3()
951 desc->data[0] |= cf->len; in can_frame_to_ican3()
952 desc->data[1] |= ICAN3_ECHO; in can_frame_to_ican3()
956 desc->data[1] |= ICAN3_SNGL; in can_frame_to_ican3()
959 desc->data[0] |= ICAN3_EFF_RTR; in can_frame_to_ican3()
963 desc->data[0] |= ICAN3_EFF; in can_frame_to_ican3()
964 desc->data[2] = (cf->can_id & 0x1fe00000) >> 21; /* 28-21 */ in can_frame_to_ican3()
965 desc->data[3] = (cf->can_id & 0x001fe000) >> 13; /* 20-13 */ in can_frame_to_ican3()
966 desc->data[4] = (cf->can_id & 0x00001fe0) >> 5; /* 12-5 */ in can_frame_to_ican3()
967 desc->data[5] = (cf->can_id & 0x0000001f) << 3; /* 4-0 */ in can_frame_to_ican3()
969 desc->data[2] = (cf->can_id & 0x7F8) >> 3; /* bits 10-3 */ in can_frame_to_ican3()
970 desc->data[3] = (cf->can_id & 0x007) << 5; /* bits 2-0 */ in can_frame_to_ican3()
974 memcpy(&desc->data[6], cf->data, cf->len); in can_frame_to_ican3()
1352 struct ican3_fast_desc __iomem *desc; in ican3_txok() local
1361 desc = mod->dpm + ((mod->fasttx_num % 16) * sizeof(*desc)); in ican3_txok()
1362 control = ioread8(&desc->control); in ican3_txok()
1380 struct ican3_fast_desc desc; in ican3_recv_skb() local
1390 desc_addr = mod->dpm + ((mod->fastrx_num % 16) * sizeof(desc)); in ican3_recv_skb()
1391 memcpy_fromio(&desc, desc_addr, sizeof(desc)); in ican3_recv_skb()
1396 if (!(desc.control & DESC_VALID)) in ican3_recv_skb()
1407 ican3_to_can_frame(mod, &desc, cf); in ican3_recv_skb()
1434 desc.control ^= DESC_VALID; in ican3_recv_skb()
1439 memcpy_toio(desc_addr, &desc, 1); in ican3_recv_skb()
1442 mod->fastrx_num = (desc.control & DESC_WRAP) ? 0 in ican3_recv_skb()
1692 struct ican3_fast_desc desc; in ican3_xmit() local
1710 desc_addr = mod->dpm + ((mod->fasttx_num % 16) * sizeof(desc)); in ican3_xmit()
1711 memset(&desc, 0, sizeof(desc)); in ican3_xmit()
1712 memcpy_fromio(&desc, desc_addr, 1); in ican3_xmit()
1715 can_frame_to_ican3(mod, cf, &desc); in ican3_xmit()
1730 desc.control |= DESC_IVALID; in ican3_xmit()
1731 memcpy_toio(desc_addr, &desc, sizeof(desc)); in ican3_xmit()
1736 desc.control ^= DESC_VALID; in ican3_xmit()
1737 memcpy_toio(desc_addr, &desc, sizeof(desc)); in ican3_xmit()
1740 mod->fasttx_num = (desc.control & DESC_WRAP) ? 0 in ican3_xmit()