Lines Matching +full:odd +full:- +full:numbered

1 // SPDX-License-Identifier: GPL-2.0-only
46 return (*data != 0xffff) ? 0 : -ETIME; in aq_mss_mdio_read()
118 * packed_record - [OUT] The table row data (raw).
269 return -EINVAL; in set_ingress_prectlf_record()
273 packed_record[0] = rec->sa_da[0] & 0xFFFF; in set_ingress_prectlf_record()
274 packed_record[1] = (rec->sa_da[0] >> 16) & 0xFFFF; in set_ingress_prectlf_record()
275 packed_record[2] = rec->sa_da[1] & 0xFFFF; in set_ingress_prectlf_record()
276 packed_record[3] = rec->eth_type & 0xFFFF; in set_ingress_prectlf_record()
277 packed_record[4] = rec->match_mask & 0xFFFF; in set_ingress_prectlf_record()
278 packed_record[5] = rec->match_type & 0xF; in set_ingress_prectlf_record()
279 packed_record[5] |= (rec->action & 0x1) << 4; in set_ingress_prectlf_record()
302 return -EINVAL; in get_ingress_prectlf_record()
304 /* If the row that we want to read is odd, first read the previous even in get_ingress_prectlf_record()
307 * odd-numbered rows. For HHD devices: this workaround will not work, in get_ingress_prectlf_record()
308 * so don't bother; odd-numbered rows are not readable. in get_ingress_prectlf_record()
313 table_index - 1); in get_ingress_prectlf_record()
324 rec->sa_da[0] = packed_record[0]; in get_ingress_prectlf_record()
325 rec->sa_da[0] |= packed_record[1] << 16; in get_ingress_prectlf_record()
327 rec->sa_da[1] = packed_record[2]; in get_ingress_prectlf_record()
329 rec->eth_type = packed_record[3]; in get_ingress_prectlf_record()
331 rec->match_mask = packed_record[4]; in get_ingress_prectlf_record()
333 rec->match_type = packed_record[5] & 0xF; in get_ingress_prectlf_record()
335 rec->action = (packed_record[5] >> 4) & 0x1; in get_ingress_prectlf_record()
358 return -EINVAL; in set_ingress_preclass_record()
362 packed_record[0] = rec->sci[0] & 0xFFFF; in set_ingress_preclass_record()
363 packed_record[1] = (rec->sci[0] >> 16) & 0xFFFF; in set_ingress_preclass_record()
365 packed_record[2] = rec->sci[1] & 0xFFFF; in set_ingress_preclass_record()
366 packed_record[3] = (rec->sci[1] >> 16) & 0xFFFF; in set_ingress_preclass_record()
368 packed_record[4] = rec->tci & 0xFF; in set_ingress_preclass_record()
370 packed_record[4] |= (rec->encr_offset & 0xFF) << 8; in set_ingress_preclass_record()
372 packed_record[5] = rec->eth_type & 0xFFFF; in set_ingress_preclass_record()
374 packed_record[6] = rec->snap[0] & 0xFFFF; in set_ingress_preclass_record()
375 packed_record[7] = (rec->snap[0] >> 16) & 0xFFFF; in set_ingress_preclass_record()
377 packed_record[8] = rec->snap[1] & 0xFF; in set_ingress_preclass_record()
379 packed_record[8] |= (rec->llc & 0xFF) << 8; in set_ingress_preclass_record()
380 packed_record[9] = (rec->llc >> 8) & 0xFFFF; in set_ingress_preclass_record()
382 packed_record[10] = rec->mac_sa[0] & 0xFFFF; in set_ingress_preclass_record()
383 packed_record[11] = (rec->mac_sa[0] >> 16) & 0xFFFF; in set_ingress_preclass_record()
385 packed_record[12] = rec->mac_sa[1] & 0xFFFF; in set_ingress_preclass_record()
387 packed_record[13] = rec->mac_da[0] & 0xFFFF; in set_ingress_preclass_record()
388 packed_record[14] = (rec->mac_da[0] >> 16) & 0xFFFF; in set_ingress_preclass_record()
390 packed_record[15] = rec->mac_da[1] & 0xFFFF; in set_ingress_preclass_record()
392 packed_record[16] = rec->lpbk_packet & 0x1; in set_ingress_preclass_record()
394 packed_record[16] |= (rec->an_mask & 0x3) << 1; in set_ingress_preclass_record()
396 packed_record[16] |= (rec->tci_mask & 0x3F) << 3; in set_ingress_preclass_record()
398 packed_record[16] |= (rec->sci_mask & 0x7F) << 9; in set_ingress_preclass_record()
399 packed_record[17] = (rec->sci_mask >> 7) & 0x1; in set_ingress_preclass_record()
401 packed_record[17] |= (rec->eth_type_mask & 0x3) << 1; in set_ingress_preclass_record()
403 packed_record[17] |= (rec->snap_mask & 0x1F) << 3; in set_ingress_preclass_record()
405 packed_record[17] |= (rec->llc_mask & 0x7) << 8; in set_ingress_preclass_record()
407 packed_record[17] |= (rec->_802_2_encapsulate & 0x1) << 11; in set_ingress_preclass_record()
409 packed_record[17] |= (rec->sa_mask & 0xF) << 12; in set_ingress_preclass_record()
410 packed_record[18] = (rec->sa_mask >> 4) & 0x3; in set_ingress_preclass_record()
412 packed_record[18] |= (rec->da_mask & 0x3F) << 2; in set_ingress_preclass_record()
414 packed_record[18] |= (rec->lpbk_mask & 0x1) << 8; in set_ingress_preclass_record()
416 packed_record[18] |= (rec->sc_idx & 0x1F) << 9; in set_ingress_preclass_record()
418 packed_record[18] |= (rec->proc_dest & 0x1) << 14; in set_ingress_preclass_record()
420 packed_record[18] |= (rec->action & 0x1) << 15; in set_ingress_preclass_record()
421 packed_record[19] = (rec->action >> 1) & 0x1; in set_ingress_preclass_record()
423 packed_record[19] |= (rec->ctrl_unctrl & 0x1) << 1; in set_ingress_preclass_record()
425 packed_record[19] |= (rec->sci_from_table & 0x1) << 2; in set_ingress_preclass_record()
427 packed_record[19] |= (rec->reserved & 0xF) << 3; in set_ingress_preclass_record()
429 packed_record[19] |= (rec->valid & 0x1) << 7; in set_ingress_preclass_record()
457 return -EINVAL; in get_ingress_preclass_record()
459 /* If the row that we want to read is odd, first read the previous even in get_ingress_preclass_record()
465 table_index - 1); in get_ingress_preclass_record()
476 rec->sci[0] = packed_record[0]; in get_ingress_preclass_record()
477 rec->sci[0] |= packed_record[1] << 16; in get_ingress_preclass_record()
479 rec->sci[1] = packed_record[2]; in get_ingress_preclass_record()
480 rec->sci[1] |= packed_record[3] << 16; in get_ingress_preclass_record()
482 rec->tci = packed_record[4] & 0xFF; in get_ingress_preclass_record()
484 rec->encr_offset = (packed_record[4] >> 8) & 0xFF; in get_ingress_preclass_record()
486 rec->eth_type = packed_record[5]; in get_ingress_preclass_record()
488 rec->snap[0] = packed_record[6]; in get_ingress_preclass_record()
489 rec->snap[0] |= packed_record[7] << 16; in get_ingress_preclass_record()
491 rec->snap[1] = packed_record[8] & 0xFF; in get_ingress_preclass_record()
493 rec->llc = (packed_record[8] >> 8) & 0xFF; in get_ingress_preclass_record()
494 rec->llc |= packed_record[9] << 8; in get_ingress_preclass_record()
496 rec->mac_sa[0] = packed_record[10]; in get_ingress_preclass_record()
497 rec->mac_sa[0] |= packed_record[11] << 16; in get_ingress_preclass_record()
499 rec->mac_sa[1] = packed_record[12]; in get_ingress_preclass_record()
501 rec->mac_da[0] = packed_record[13]; in get_ingress_preclass_record()
502 rec->mac_da[0] |= packed_record[14] << 16; in get_ingress_preclass_record()
504 rec->mac_da[1] = packed_record[15]; in get_ingress_preclass_record()
506 rec->lpbk_packet = packed_record[16] & 0x1; in get_ingress_preclass_record()
508 rec->an_mask = (packed_record[16] >> 1) & 0x3; in get_ingress_preclass_record()
510 rec->tci_mask = (packed_record[16] >> 3) & 0x3F; in get_ingress_preclass_record()
512 rec->sci_mask = (packed_record[16] >> 9) & 0x7F; in get_ingress_preclass_record()
513 rec->sci_mask |= (packed_record[17] & 0x1) << 7; in get_ingress_preclass_record()
515 rec->eth_type_mask = (packed_record[17] >> 1) & 0x3; in get_ingress_preclass_record()
517 rec->snap_mask = (packed_record[17] >> 3) & 0x1F; in get_ingress_preclass_record()
519 rec->llc_mask = (packed_record[17] >> 8) & 0x7; in get_ingress_preclass_record()
521 rec->_802_2_encapsulate = (packed_record[17] >> 11) & 0x1; in get_ingress_preclass_record()
523 rec->sa_mask = (packed_record[17] >> 12) & 0xF; in get_ingress_preclass_record()
524 rec->sa_mask |= (packed_record[18] & 0x3) << 4; in get_ingress_preclass_record()
526 rec->da_mask = (packed_record[18] >> 2) & 0x3F; in get_ingress_preclass_record()
528 rec->lpbk_mask = (packed_record[18] >> 8) & 0x1; in get_ingress_preclass_record()
530 rec->sc_idx = (packed_record[18] >> 9) & 0x1F; in get_ingress_preclass_record()
532 rec->proc_dest = (packed_record[18] >> 14) & 0x1; in get_ingress_preclass_record()
534 rec->action = (packed_record[18] >> 15) & 0x1; in get_ingress_preclass_record()
535 rec->action |= (packed_record[19] & 0x1) << 1; in get_ingress_preclass_record()
537 rec->ctrl_unctrl = (packed_record[19] >> 1) & 0x1; in get_ingress_preclass_record()
539 rec->sci_from_table = (packed_record[19] >> 2) & 0x1; in get_ingress_preclass_record()
541 rec->reserved = (packed_record[19] >> 3) & 0xF; in get_ingress_preclass_record()
543 rec->valid = (packed_record[19] >> 7) & 0x1; in get_ingress_preclass_record()
565 return -EINVAL; in set_ingress_sc_record()
569 packed_record[0] = rec->stop_time & 0xFFFF; in set_ingress_sc_record()
570 packed_record[1] = (rec->stop_time >> 16) & 0xFFFF; in set_ingress_sc_record()
572 packed_record[2] = rec->start_time & 0xFFFF; in set_ingress_sc_record()
573 packed_record[3] = (rec->start_time >> 16) & 0xFFFF; in set_ingress_sc_record()
575 packed_record[4] = rec->validate_frames & 0x3; in set_ingress_sc_record()
577 packed_record[4] |= (rec->replay_protect & 0x1) << 2; in set_ingress_sc_record()
579 packed_record[4] |= (rec->anti_replay_window & 0x1FFF) << 3; in set_ingress_sc_record()
580 packed_record[5] = (rec->anti_replay_window >> 13) & 0xFFFF; in set_ingress_sc_record()
581 packed_record[6] = (rec->anti_replay_window >> 29) & 0x7; in set_ingress_sc_record()
583 packed_record[6] |= (rec->receiving & 0x1) << 3; in set_ingress_sc_record()
585 packed_record[6] |= (rec->fresh & 0x1) << 4; in set_ingress_sc_record()
587 packed_record[6] |= (rec->an_rol & 0x1) << 5; in set_ingress_sc_record()
589 packed_record[6] |= (rec->reserved & 0x3FF) << 6; in set_ingress_sc_record()
590 packed_record[7] = (rec->reserved >> 10) & 0x7FFF; in set_ingress_sc_record()
592 packed_record[7] |= (rec->valid & 0x1) << 15; in set_ingress_sc_record()
617 return -EINVAL; in get_ingress_sc_record()
624 rec->stop_time = packed_record[0]; in get_ingress_sc_record()
625 rec->stop_time |= packed_record[1] << 16; in get_ingress_sc_record()
627 rec->start_time = packed_record[2]; in get_ingress_sc_record()
628 rec->start_time |= packed_record[3] << 16; in get_ingress_sc_record()
630 rec->validate_frames = packed_record[4] & 0x3; in get_ingress_sc_record()
632 rec->replay_protect = (packed_record[4] >> 2) & 0x1; in get_ingress_sc_record()
634 rec->anti_replay_window = (packed_record[4] >> 3) & 0x1FFF; in get_ingress_sc_record()
635 rec->anti_replay_window |= packed_record[5] << 13; in get_ingress_sc_record()
636 rec->anti_replay_window |= (packed_record[6] & 0x7) << 29; in get_ingress_sc_record()
638 rec->receiving = (packed_record[6] >> 3) & 0x1; in get_ingress_sc_record()
640 rec->fresh = (packed_record[6] >> 4) & 0x1; in get_ingress_sc_record()
642 rec->an_rol = (packed_record[6] >> 5) & 0x1; in get_ingress_sc_record()
644 rec->reserved = (packed_record[6] >> 6) & 0x3FF; in get_ingress_sc_record()
645 rec->reserved |= (packed_record[7] & 0x7FFF) << 10; in get_ingress_sc_record()
647 rec->valid = (packed_record[7] >> 15) & 0x1; in get_ingress_sc_record()
668 return -EINVAL; in set_ingress_sa_record()
672 packed_record[0] = rec->stop_time & 0xFFFF; in set_ingress_sa_record()
673 packed_record[1] = (rec->stop_time >> 16) & 0xFFFF; in set_ingress_sa_record()
675 packed_record[2] = rec->start_time & 0xFFFF; in set_ingress_sa_record()
676 packed_record[3] = (rec->start_time >> 16) & 0xFFFF; in set_ingress_sa_record()
678 packed_record[4] = rec->next_pn & 0xFFFF; in set_ingress_sa_record()
679 packed_record[5] = (rec->next_pn >> 16) & 0xFFFF; in set_ingress_sa_record()
681 packed_record[6] = rec->sat_nextpn & 0x1; in set_ingress_sa_record()
683 packed_record[6] |= (rec->in_use & 0x1) << 1; in set_ingress_sa_record()
685 packed_record[6] |= (rec->fresh & 0x1) << 2; in set_ingress_sa_record()
687 packed_record[6] |= (rec->reserved & 0x1FFF) << 3; in set_ingress_sa_record()
688 packed_record[7] = (rec->reserved >> 13) & 0x7FFF; in set_ingress_sa_record()
690 packed_record[7] |= (rec->valid & 0x1) << 15; in set_ingress_sa_record()
715 return -EINVAL; in get_ingress_sa_record()
722 rec->stop_time = packed_record[0]; in get_ingress_sa_record()
723 rec->stop_time |= packed_record[1] << 16; in get_ingress_sa_record()
725 rec->start_time = packed_record[2]; in get_ingress_sa_record()
726 rec->start_time |= packed_record[3] << 16; in get_ingress_sa_record()
728 rec->next_pn = packed_record[4]; in get_ingress_sa_record()
729 rec->next_pn |= packed_record[5] << 16; in get_ingress_sa_record()
731 rec->sat_nextpn = packed_record[6] & 0x1; in get_ingress_sa_record()
733 rec->in_use = (packed_record[6] >> 1) & 0x1; in get_ingress_sa_record()
735 rec->fresh = (packed_record[6] >> 2) & 0x1; in get_ingress_sa_record()
737 rec->reserved = (packed_record[6] >> 3) & 0x1FFF; in get_ingress_sa_record()
738 rec->reserved |= (packed_record[7] & 0x7FFF) << 13; in get_ingress_sa_record()
740 rec->valid = (packed_record[7] >> 15) & 0x1; in get_ingress_sa_record()
763 return -EINVAL; in set_ingress_sakey_record()
767 packed_record[0] = rec->key[0] & 0xFFFF; in set_ingress_sakey_record()
768 packed_record[1] = (rec->key[0] >> 16) & 0xFFFF; in set_ingress_sakey_record()
770 packed_record[2] = rec->key[1] & 0xFFFF; in set_ingress_sakey_record()
771 packed_record[3] = (rec->key[1] >> 16) & 0xFFFF; in set_ingress_sakey_record()
773 packed_record[4] = rec->key[2] & 0xFFFF; in set_ingress_sakey_record()
774 packed_record[5] = (rec->key[2] >> 16) & 0xFFFF; in set_ingress_sakey_record()
776 packed_record[6] = rec->key[3] & 0xFFFF; in set_ingress_sakey_record()
777 packed_record[7] = (rec->key[3] >> 16) & 0xFFFF; in set_ingress_sakey_record()
779 packed_record[8] = rec->key[4] & 0xFFFF; in set_ingress_sakey_record()
780 packed_record[9] = (rec->key[4] >> 16) & 0xFFFF; in set_ingress_sakey_record()
782 packed_record[10] = rec->key[5] & 0xFFFF; in set_ingress_sakey_record()
783 packed_record[11] = (rec->key[5] >> 16) & 0xFFFF; in set_ingress_sakey_record()
785 packed_record[12] = rec->key[6] & 0xFFFF; in set_ingress_sakey_record()
786 packed_record[13] = (rec->key[6] >> 16) & 0xFFFF; in set_ingress_sakey_record()
788 packed_record[14] = rec->key[7] & 0xFFFF; in set_ingress_sakey_record()
789 packed_record[15] = (rec->key[7] >> 16) & 0xFFFF; in set_ingress_sakey_record()
791 packed_record[16] = rec->key_len & 0x3; in set_ingress_sakey_record()
821 return -EINVAL; in get_ingress_sakey_record()
829 rec->key[0] = packed_record[0]; in get_ingress_sakey_record()
830 rec->key[0] |= packed_record[1] << 16; in get_ingress_sakey_record()
832 rec->key[1] = packed_record[2]; in get_ingress_sakey_record()
833 rec->key[1] |= packed_record[3] << 16; in get_ingress_sakey_record()
835 rec->key[2] = packed_record[4]; in get_ingress_sakey_record()
836 rec->key[2] |= packed_record[5] << 16; in get_ingress_sakey_record()
838 rec->key[3] = packed_record[6]; in get_ingress_sakey_record()
839 rec->key[3] |= packed_record[7] << 16; in get_ingress_sakey_record()
841 rec->key[4] = packed_record[8]; in get_ingress_sakey_record()
842 rec->key[4] |= packed_record[9] << 16; in get_ingress_sakey_record()
844 rec->key[5] = packed_record[10]; in get_ingress_sakey_record()
845 rec->key[5] |= packed_record[11] << 16; in get_ingress_sakey_record()
847 rec->key[6] = packed_record[12]; in get_ingress_sakey_record()
848 rec->key[6] |= packed_record[13] << 16; in get_ingress_sakey_record()
850 rec->key[7] = packed_record[14]; in get_ingress_sakey_record()
851 rec->key[7] |= packed_record[15] << 16; in get_ingress_sakey_record()
853 rec->key_len = packed_record[16] & 0x3; in get_ingress_sakey_record()
875 return -EINVAL; in set_ingress_postclass_record()
879 packed_record[0] = rec->byte0 & 0xFF; in set_ingress_postclass_record()
881 packed_record[0] |= (rec->byte1 & 0xFF) << 8; in set_ingress_postclass_record()
883 packed_record[1] = rec->byte2 & 0xFF; in set_ingress_postclass_record()
885 packed_record[1] |= (rec->byte3 & 0xFF) << 8; in set_ingress_postclass_record()
887 packed_record[2] = rec->eth_type & 0xFFFF; in set_ingress_postclass_record()
889 packed_record[3] = rec->eth_type_valid & 0x1; in set_ingress_postclass_record()
891 packed_record[3] |= (rec->vlan_id & 0xFFF) << 1; in set_ingress_postclass_record()
893 packed_record[3] |= (rec->vlan_up & 0x7) << 13; in set_ingress_postclass_record()
895 packed_record[4] = rec->vlan_valid & 0x1; in set_ingress_postclass_record()
897 packed_record[4] |= (rec->sai & 0x1F) << 1; in set_ingress_postclass_record()
899 packed_record[4] |= (rec->sai_hit & 0x1) << 6; in set_ingress_postclass_record()
901 packed_record[4] |= (rec->eth_type_mask & 0xF) << 7; in set_ingress_postclass_record()
903 packed_record[4] |= (rec->byte3_location & 0x1F) << 11; in set_ingress_postclass_record()
904 packed_record[5] = (rec->byte3_location >> 5) & 0x1; in set_ingress_postclass_record()
906 packed_record[5] |= (rec->byte3_mask & 0x3) << 1; in set_ingress_postclass_record()
908 packed_record[5] |= (rec->byte2_location & 0x3F) << 3; in set_ingress_postclass_record()
910 packed_record[5] |= (rec->byte2_mask & 0x3) << 9; in set_ingress_postclass_record()
912 packed_record[5] |= (rec->byte1_location & 0x1F) << 11; in set_ingress_postclass_record()
913 packed_record[6] = (rec->byte1_location >> 5) & 0x1; in set_ingress_postclass_record()
915 packed_record[6] |= (rec->byte1_mask & 0x3) << 1; in set_ingress_postclass_record()
917 packed_record[6] |= (rec->byte0_location & 0x3F) << 3; in set_ingress_postclass_record()
919 packed_record[6] |= (rec->byte0_mask & 0x3) << 9; in set_ingress_postclass_record()
921 packed_record[6] |= (rec->eth_type_valid_mask & 0x3) << 11; in set_ingress_postclass_record()
923 packed_record[6] |= (rec->vlan_id_mask & 0x7) << 13; in set_ingress_postclass_record()
924 packed_record[7] = (rec->vlan_id_mask >> 3) & 0x1; in set_ingress_postclass_record()
926 packed_record[7] |= (rec->vlan_up_mask & 0x3) << 1; in set_ingress_postclass_record()
928 packed_record[7] |= (rec->vlan_valid_mask & 0x3) << 3; in set_ingress_postclass_record()
930 packed_record[7] |= (rec->sai_mask & 0x3) << 5; in set_ingress_postclass_record()
932 packed_record[7] |= (rec->sai_hit_mask & 0x3) << 7; in set_ingress_postclass_record()
934 packed_record[7] |= (rec->firstlevel_actions & 0x1) << 9; in set_ingress_postclass_record()
936 packed_record[7] |= (rec->secondlevel_actions & 0x1) << 10; in set_ingress_postclass_record()
938 packed_record[7] |= (rec->reserved & 0xF) << 11; in set_ingress_postclass_record()
940 packed_record[7] |= (rec->valid & 0x1) << 15; in set_ingress_postclass_record()
964 return -EINVAL; in get_ingress_postclass_record()
966 /* If the row that we want to read is odd, first read the previous even in get_ingress_postclass_record()
972 table_index - 1); in get_ingress_postclass_record()
983 rec->byte0 = packed_record[0] & 0xFF; in get_ingress_postclass_record()
985 rec->byte1 = (packed_record[0] >> 8) & 0xFF; in get_ingress_postclass_record()
987 rec->byte2 = packed_record[1] & 0xFF; in get_ingress_postclass_record()
989 rec->byte3 = (packed_record[1] >> 8) & 0xFF; in get_ingress_postclass_record()
991 rec->eth_type = packed_record[2]; in get_ingress_postclass_record()
993 rec->eth_type_valid = packed_record[3] & 0x1; in get_ingress_postclass_record()
995 rec->vlan_id = (packed_record[3] >> 1) & 0xFFF; in get_ingress_postclass_record()
997 rec->vlan_up = (packed_record[3] >> 13) & 0x7; in get_ingress_postclass_record()
999 rec->vlan_valid = packed_record[4] & 0x1; in get_ingress_postclass_record()
1001 rec->sai = (packed_record[4] >> 1) & 0x1F; in get_ingress_postclass_record()
1003 rec->sai_hit = (packed_record[4] >> 6) & 0x1; in get_ingress_postclass_record()
1005 rec->eth_type_mask = (packed_record[4] >> 7) & 0xF; in get_ingress_postclass_record()
1007 rec->byte3_location = (packed_record[4] >> 11) & 0x1F; in get_ingress_postclass_record()
1008 rec->byte3_location |= (packed_record[5] & 0x1) << 5; in get_ingress_postclass_record()
1010 rec->byte3_mask = (packed_record[5] >> 1) & 0x3; in get_ingress_postclass_record()
1012 rec->byte2_location = (packed_record[5] >> 3) & 0x3F; in get_ingress_postclass_record()
1014 rec->byte2_mask = (packed_record[5] >> 9) & 0x3; in get_ingress_postclass_record()
1016 rec->byte1_location = (packed_record[5] >> 11) & 0x1F; in get_ingress_postclass_record()
1017 rec->byte1_location |= (packed_record[6] & 0x1) << 5; in get_ingress_postclass_record()
1019 rec->byte1_mask = (packed_record[6] >> 1) & 0x3; in get_ingress_postclass_record()
1021 rec->byte0_location = (packed_record[6] >> 3) & 0x3F; in get_ingress_postclass_record()
1023 rec->byte0_mask = (packed_record[6] >> 9) & 0x3; in get_ingress_postclass_record()
1025 rec->eth_type_valid_mask = (packed_record[6] >> 11) & 0x3; in get_ingress_postclass_record()
1027 rec->vlan_id_mask = (packed_record[6] >> 13) & 0x7; in get_ingress_postclass_record()
1028 rec->vlan_id_mask |= (packed_record[7] & 0x1) << 3; in get_ingress_postclass_record()
1030 rec->vlan_up_mask = (packed_record[7] >> 1) & 0x3; in get_ingress_postclass_record()
1032 rec->vlan_valid_mask = (packed_record[7] >> 3) & 0x3; in get_ingress_postclass_record()
1034 rec->sai_mask = (packed_record[7] >> 5) & 0x3; in get_ingress_postclass_record()
1036 rec->sai_hit_mask = (packed_record[7] >> 7) & 0x3; in get_ingress_postclass_record()
1038 rec->firstlevel_actions = (packed_record[7] >> 9) & 0x1; in get_ingress_postclass_record()
1040 rec->secondlevel_actions = (packed_record[7] >> 10) & 0x1; in get_ingress_postclass_record()
1042 rec->reserved = (packed_record[7] >> 11) & 0xF; in get_ingress_postclass_record()
1044 rec->valid = (packed_record[7] >> 15) & 0x1; in get_ingress_postclass_record()
1067 return -EINVAL; in set_ingress_postctlf_record()
1071 packed_record[0] = rec->sa_da[0] & 0xFFFF; in set_ingress_postctlf_record()
1072 packed_record[1] = (rec->sa_da[0] >> 16) & 0xFFFF; in set_ingress_postctlf_record()
1074 packed_record[2] = rec->sa_da[1] & 0xFFFF; in set_ingress_postctlf_record()
1076 packed_record[3] = rec->eth_type & 0xFFFF; in set_ingress_postctlf_record()
1078 packed_record[4] = rec->match_mask & 0xFFFF; in set_ingress_postctlf_record()
1080 packed_record[5] = rec->match_type & 0xF; in set_ingress_postctlf_record()
1082 packed_record[5] |= (rec->action & 0x1) << 4; in set_ingress_postctlf_record()
1106 return -EINVAL; in get_ingress_postctlf_record()
1108 /* If the row that we want to read is odd, first read the previous even in get_ingress_postctlf_record()
1114 table_index - 1); in get_ingress_postctlf_record()
1125 rec->sa_da[0] = packed_record[0]; in get_ingress_postctlf_record()
1126 rec->sa_da[0] |= packed_record[1] << 16; in get_ingress_postctlf_record()
1128 rec->sa_da[1] = packed_record[2]; in get_ingress_postctlf_record()
1130 rec->eth_type = packed_record[3]; in get_ingress_postctlf_record()
1132 rec->match_mask = packed_record[4]; in get_ingress_postctlf_record()
1134 rec->match_type = packed_record[5] & 0xF; in get_ingress_postctlf_record()
1136 rec->action = (packed_record[5] >> 4) & 0x1; in get_ingress_postctlf_record()
1158 return -EINVAL; in set_egress_ctlf_record()
1162 packed_record[0] = rec->sa_da[0] & 0xFFFF; in set_egress_ctlf_record()
1163 packed_record[1] = (rec->sa_da[0] >> 16) & 0xFFFF; in set_egress_ctlf_record()
1165 packed_record[2] = rec->sa_da[1] & 0xFFFF; in set_egress_ctlf_record()
1167 packed_record[3] = rec->eth_type & 0xFFFF; in set_egress_ctlf_record()
1169 packed_record[4] = rec->match_mask & 0xFFFF; in set_egress_ctlf_record()
1171 packed_record[5] = rec->match_type & 0xF; in set_egress_ctlf_record()
1173 packed_record[5] |= (rec->action & 0x1) << 4; in set_egress_ctlf_record()
1194 return -EINVAL; in get_egress_ctlf_record()
1196 /* If the row that we want to read is odd, first read the previous even in get_egress_ctlf_record()
1202 table_index - 1); in get_egress_ctlf_record()
1212 rec->sa_da[0] = packed_record[0]; in get_egress_ctlf_record()
1213 rec->sa_da[0] |= packed_record[1] << 16; in get_egress_ctlf_record()
1215 rec->sa_da[1] = packed_record[2]; in get_egress_ctlf_record()
1217 rec->eth_type = packed_record[3]; in get_egress_ctlf_record()
1219 rec->match_mask = packed_record[4]; in get_egress_ctlf_record()
1221 rec->match_type = packed_record[5] & 0xF; in get_egress_ctlf_record()
1223 rec->action = (packed_record[5] >> 4) & 0x1; in get_egress_ctlf_record()
1244 return -EINVAL; in set_egress_class_record()
1248 packed_record[0] = rec->vlan_id & 0xFFF; in set_egress_class_record()
1250 packed_record[0] |= (rec->vlan_up & 0x7) << 12; in set_egress_class_record()
1252 packed_record[0] |= (rec->vlan_valid & 0x1) << 15; in set_egress_class_record()
1254 packed_record[1] = rec->byte3 & 0xFF; in set_egress_class_record()
1256 packed_record[1] |= (rec->byte2 & 0xFF) << 8; in set_egress_class_record()
1258 packed_record[2] = rec->byte1 & 0xFF; in set_egress_class_record()
1260 packed_record[2] |= (rec->byte0 & 0xFF) << 8; in set_egress_class_record()
1262 packed_record[3] = rec->tci & 0xFF; in set_egress_class_record()
1264 packed_record[3] |= (rec->sci[0] & 0xFF) << 8; in set_egress_class_record()
1265 packed_record[4] = (rec->sci[0] >> 8) & 0xFFFF; in set_egress_class_record()
1266 packed_record[5] = (rec->sci[0] >> 24) & 0xFF; in set_egress_class_record()
1268 packed_record[5] |= (rec->sci[1] & 0xFF) << 8; in set_egress_class_record()
1269 packed_record[6] = (rec->sci[1] >> 8) & 0xFFFF; in set_egress_class_record()
1270 packed_record[7] = (rec->sci[1] >> 24) & 0xFF; in set_egress_class_record()
1272 packed_record[7] |= (rec->eth_type & 0xFF) << 8; in set_egress_class_record()
1273 packed_record[8] = (rec->eth_type >> 8) & 0xFF; in set_egress_class_record()
1275 packed_record[8] |= (rec->snap[0] & 0xFF) << 8; in set_egress_class_record()
1276 packed_record[9] = (rec->snap[0] >> 8) & 0xFFFF; in set_egress_class_record()
1277 packed_record[10] = (rec->snap[0] >> 24) & 0xFF; in set_egress_class_record()
1279 packed_record[10] |= (rec->snap[1] & 0xFF) << 8; in set_egress_class_record()
1281 packed_record[11] = rec->llc & 0xFFFF; in set_egress_class_record()
1282 packed_record[12] = (rec->llc >> 16) & 0xFF; in set_egress_class_record()
1284 packed_record[12] |= (rec->mac_sa[0] & 0xFF) << 8; in set_egress_class_record()
1285 packed_record[13] = (rec->mac_sa[0] >> 8) & 0xFFFF; in set_egress_class_record()
1286 packed_record[14] = (rec->mac_sa[0] >> 24) & 0xFF; in set_egress_class_record()
1288 packed_record[14] |= (rec->mac_sa[1] & 0xFF) << 8; in set_egress_class_record()
1289 packed_record[15] = (rec->mac_sa[1] >> 8) & 0xFF; in set_egress_class_record()
1291 packed_record[15] |= (rec->mac_da[0] & 0xFF) << 8; in set_egress_class_record()
1292 packed_record[16] = (rec->mac_da[0] >> 8) & 0xFFFF; in set_egress_class_record()
1293 packed_record[17] = (rec->mac_da[0] >> 24) & 0xFF; in set_egress_class_record()
1295 packed_record[17] |= (rec->mac_da[1] & 0xFF) << 8; in set_egress_class_record()
1296 packed_record[18] = (rec->mac_da[1] >> 8) & 0xFF; in set_egress_class_record()
1298 packed_record[18] |= (rec->pn & 0xFF) << 8; in set_egress_class_record()
1299 packed_record[19] = (rec->pn >> 8) & 0xFFFF; in set_egress_class_record()
1300 packed_record[20] = (rec->pn >> 24) & 0xFF; in set_egress_class_record()
1302 packed_record[20] |= (rec->byte3_location & 0x3F) << 8; in set_egress_class_record()
1304 packed_record[20] |= (rec->byte3_mask & 0x1) << 14; in set_egress_class_record()
1306 packed_record[20] |= (rec->byte2_location & 0x1) << 15; in set_egress_class_record()
1307 packed_record[21] = (rec->byte2_location >> 1) & 0x1F; in set_egress_class_record()
1309 packed_record[21] |= (rec->byte2_mask & 0x1) << 5; in set_egress_class_record()
1311 packed_record[21] |= (rec->byte1_location & 0x3F) << 6; in set_egress_class_record()
1313 packed_record[21] |= (rec->byte1_mask & 0x1) << 12; in set_egress_class_record()
1315 packed_record[21] |= (rec->byte0_location & 0x7) << 13; in set_egress_class_record()
1316 packed_record[22] = (rec->byte0_location >> 3) & 0x7; in set_egress_class_record()
1318 packed_record[22] |= (rec->byte0_mask & 0x1) << 3; in set_egress_class_record()
1320 packed_record[22] |= (rec->vlan_id_mask & 0x3) << 4; in set_egress_class_record()
1322 packed_record[22] |= (rec->vlan_up_mask & 0x1) << 6; in set_egress_class_record()
1324 packed_record[22] |= (rec->vlan_valid_mask & 0x1) << 7; in set_egress_class_record()
1326 packed_record[22] |= (rec->tci_mask & 0xFF) << 8; in set_egress_class_record()
1328 packed_record[23] = rec->sci_mask & 0xFF; in set_egress_class_record()
1330 packed_record[23] |= (rec->eth_type_mask & 0x3) << 8; in set_egress_class_record()
1332 packed_record[23] |= (rec->snap_mask & 0x1F) << 10; in set_egress_class_record()
1334 packed_record[23] |= (rec->llc_mask & 0x1) << 15; in set_egress_class_record()
1335 packed_record[24] = (rec->llc_mask >> 1) & 0x3; in set_egress_class_record()
1337 packed_record[24] |= (rec->sa_mask & 0x3F) << 2; in set_egress_class_record()
1339 packed_record[24] |= (rec->da_mask & 0x3F) << 8; in set_egress_class_record()
1341 packed_record[24] |= (rec->pn_mask & 0x3) << 14; in set_egress_class_record()
1342 packed_record[25] = (rec->pn_mask >> 2) & 0x3; in set_egress_class_record()
1344 packed_record[25] |= (rec->eight02dot2 & 0x1) << 2; in set_egress_class_record()
1346 packed_record[25] |= (rec->tci_sc & 0x1) << 3; in set_egress_class_record()
1348 packed_record[25] |= (rec->tci_87543 & 0x1) << 4; in set_egress_class_record()
1350 packed_record[25] |= (rec->exp_sectag_en & 0x1) << 5; in set_egress_class_record()
1352 packed_record[25] |= (rec->sc_idx & 0x1F) << 6; in set_egress_class_record()
1354 packed_record[25] |= (rec->sc_sa & 0x3) << 11; in set_egress_class_record()
1356 packed_record[25] |= (rec->debug & 0x1) << 13; in set_egress_class_record()
1358 packed_record[25] |= (rec->action & 0x3) << 14; in set_egress_class_record()
1360 packed_record[26] = (rec->valid & 0x1) << 3; in set_egress_class_record()
1381 return -EINVAL; in get_egress_class_record()
1383 /* If the row that we want to read is odd, first read the previous even in get_egress_class_record()
1389 table_index - 1); in get_egress_class_record()
1399 rec->vlan_id = packed_record[0] & 0xFFF; in get_egress_class_record()
1401 rec->vlan_up = (packed_record[0] >> 12) & 0x7; in get_egress_class_record()
1403 rec->vlan_valid = (packed_record[0] >> 15) & 0x1; in get_egress_class_record()
1405 rec->byte3 = packed_record[1] & 0xFF; in get_egress_class_record()
1407 rec->byte2 = (packed_record[1] >> 8) & 0xFF; in get_egress_class_record()
1409 rec->byte1 = packed_record[2] & 0xFF; in get_egress_class_record()
1411 rec->byte0 = (packed_record[2] >> 8) & 0xFF; in get_egress_class_record()
1413 rec->tci = packed_record[3] & 0xFF; in get_egress_class_record()
1415 rec->sci[0] = (packed_record[3] >> 8) & 0xFF; in get_egress_class_record()
1416 rec->sci[0] |= packed_record[4] << 8; in get_egress_class_record()
1417 rec->sci[0] |= (packed_record[5] & 0xFF) << 24; in get_egress_class_record()
1419 rec->sci[1] = (packed_record[5] >> 8) & 0xFF; in get_egress_class_record()
1420 rec->sci[1] |= packed_record[6] << 8; in get_egress_class_record()
1421 rec->sci[1] |= (packed_record[7] & 0xFF) << 24; in get_egress_class_record()
1423 rec->eth_type = (packed_record[7] >> 8) & 0xFF; in get_egress_class_record()
1424 rec->eth_type |= (packed_record[8] & 0xFF) << 8; in get_egress_class_record()
1426 rec->snap[0] = (packed_record[8] >> 8) & 0xFF; in get_egress_class_record()
1427 rec->snap[0] |= packed_record[9] << 8; in get_egress_class_record()
1428 rec->snap[0] |= (packed_record[10] & 0xFF) << 24; in get_egress_class_record()
1430 rec->snap[1] = (packed_record[10] >> 8) & 0xFF; in get_egress_class_record()
1432 rec->llc = packed_record[11]; in get_egress_class_record()
1433 rec->llc |= (packed_record[12] & 0xFF) << 16; in get_egress_class_record()
1435 rec->mac_sa[0] = (packed_record[12] >> 8) & 0xFF; in get_egress_class_record()
1436 rec->mac_sa[0] |= packed_record[13] << 8; in get_egress_class_record()
1437 rec->mac_sa[0] |= (packed_record[14] & 0xFF) << 24; in get_egress_class_record()
1439 rec->mac_sa[1] = (packed_record[14] >> 8) & 0xFF; in get_egress_class_record()
1440 rec->mac_sa[1] |= (packed_record[15] & 0xFF) << 8; in get_egress_class_record()
1442 rec->mac_da[0] = (packed_record[15] >> 8) & 0xFF; in get_egress_class_record()
1443 rec->mac_da[0] |= packed_record[16] << 8; in get_egress_class_record()
1444 rec->mac_da[0] |= (packed_record[17] & 0xFF) << 24; in get_egress_class_record()
1446 rec->mac_da[1] = (packed_record[17] >> 8) & 0xFF; in get_egress_class_record()
1447 rec->mac_da[1] |= (packed_record[18] & 0xFF) << 8; in get_egress_class_record()
1449 rec->pn = (packed_record[18] >> 8) & 0xFF; in get_egress_class_record()
1450 rec->pn |= packed_record[19] << 8; in get_egress_class_record()
1451 rec->pn |= (packed_record[20] & 0xFF) << 24; in get_egress_class_record()
1453 rec->byte3_location = (packed_record[20] >> 8) & 0x3F; in get_egress_class_record()
1455 rec->byte3_mask = (packed_record[20] >> 14) & 0x1; in get_egress_class_record()
1457 rec->byte2_location = (packed_record[20] >> 15) & 0x1; in get_egress_class_record()
1458 rec->byte2_location |= (packed_record[21] & 0x1F) << 1; in get_egress_class_record()
1460 rec->byte2_mask = (packed_record[21] >> 5) & 0x1; in get_egress_class_record()
1462 rec->byte1_location = (packed_record[21] >> 6) & 0x3F; in get_egress_class_record()
1464 rec->byte1_mask = (packed_record[21] >> 12) & 0x1; in get_egress_class_record()
1466 rec->byte0_location = (packed_record[21] >> 13) & 0x7; in get_egress_class_record()
1467 rec->byte0_location |= (packed_record[22] & 0x7) << 3; in get_egress_class_record()
1469 rec->byte0_mask = (packed_record[22] >> 3) & 0x1; in get_egress_class_record()
1471 rec->vlan_id_mask = (packed_record[22] >> 4) & 0x3; in get_egress_class_record()
1473 rec->vlan_up_mask = (packed_record[22] >> 6) & 0x1; in get_egress_class_record()
1475 rec->vlan_valid_mask = (packed_record[22] >> 7) & 0x1; in get_egress_class_record()
1477 rec->tci_mask = (packed_record[22] >> 8) & 0xFF; in get_egress_class_record()
1479 rec->sci_mask = packed_record[23] & 0xFF; in get_egress_class_record()
1481 rec->eth_type_mask = (packed_record[23] >> 8) & 0x3; in get_egress_class_record()
1483 rec->snap_mask = (packed_record[23] >> 10) & 0x1F; in get_egress_class_record()
1485 rec->llc_mask = (packed_record[23] >> 15) & 0x1; in get_egress_class_record()
1486 rec->llc_mask |= (packed_record[24] & 0x3) << 1; in get_egress_class_record()
1488 rec->sa_mask = (packed_record[24] >> 2) & 0x3F; in get_egress_class_record()
1490 rec->da_mask = (packed_record[24] >> 8) & 0x3F; in get_egress_class_record()
1492 rec->pn_mask = (packed_record[24] >> 14) & 0x3; in get_egress_class_record()
1493 rec->pn_mask |= (packed_record[25] & 0x3) << 2; in get_egress_class_record()
1495 rec->eight02dot2 = (packed_record[25] >> 2) & 0x1; in get_egress_class_record()
1497 rec->tci_sc = (packed_record[25] >> 3) & 0x1; in get_egress_class_record()
1499 rec->tci_87543 = (packed_record[25] >> 4) & 0x1; in get_egress_class_record()
1501 rec->exp_sectag_en = (packed_record[25] >> 5) & 0x1; in get_egress_class_record()
1503 rec->sc_idx = (packed_record[25] >> 6) & 0x1F; in get_egress_class_record()
1505 rec->sc_sa = (packed_record[25] >> 11) & 0x3; in get_egress_class_record()
1507 rec->debug = (packed_record[25] >> 13) & 0x1; in get_egress_class_record()
1509 rec->action = (packed_record[25] >> 14) & 0x3; in get_egress_class_record()
1511 rec->valid = (packed_record[26] >> 3) & 0x1; in get_egress_class_record()
1532 return -EINVAL; in set_egress_sc_record()
1536 packed_record[0] = rec->start_time & 0xFFFF; in set_egress_sc_record()
1537 packed_record[1] = (rec->start_time >> 16) & 0xFFFF; in set_egress_sc_record()
1539 packed_record[2] = rec->stop_time & 0xFFFF; in set_egress_sc_record()
1540 packed_record[3] = (rec->stop_time >> 16) & 0xFFFF; in set_egress_sc_record()
1542 packed_record[4] = rec->curr_an & 0x3; in set_egress_sc_record()
1544 packed_record[4] |= (rec->an_roll & 0x1) << 2; in set_egress_sc_record()
1546 packed_record[4] |= (rec->tci & 0x3F) << 3; in set_egress_sc_record()
1548 packed_record[4] |= (rec->enc_off & 0x7F) << 9; in set_egress_sc_record()
1549 packed_record[5] = (rec->enc_off >> 7) & 0x1; in set_egress_sc_record()
1551 packed_record[5] |= (rec->protect & 0x1) << 1; in set_egress_sc_record()
1553 packed_record[5] |= (rec->recv & 0x1) << 2; in set_egress_sc_record()
1555 packed_record[5] |= (rec->fresh & 0x1) << 3; in set_egress_sc_record()
1557 packed_record[5] |= (rec->sak_len & 0x3) << 4; in set_egress_sc_record()
1559 packed_record[7] = (rec->valid & 0x1) << 15; in set_egress_sc_record()
1580 return -EINVAL; in get_egress_sc_record()
1587 rec->start_time = packed_record[0]; in get_egress_sc_record()
1588 rec->start_time |= packed_record[1] << 16; in get_egress_sc_record()
1590 rec->stop_time = packed_record[2]; in get_egress_sc_record()
1591 rec->stop_time |= packed_record[3] << 16; in get_egress_sc_record()
1593 rec->curr_an = packed_record[4] & 0x3; in get_egress_sc_record()
1595 rec->an_roll = (packed_record[4] >> 2) & 0x1; in get_egress_sc_record()
1597 rec->tci = (packed_record[4] >> 3) & 0x3F; in get_egress_sc_record()
1599 rec->enc_off = (packed_record[4] >> 9) & 0x7F; in get_egress_sc_record()
1600 rec->enc_off |= (packed_record[5] & 0x1) << 7; in get_egress_sc_record()
1602 rec->protect = (packed_record[5] >> 1) & 0x1; in get_egress_sc_record()
1604 rec->recv = (packed_record[5] >> 2) & 0x1; in get_egress_sc_record()
1606 rec->fresh = (packed_record[5] >> 3) & 0x1; in get_egress_sc_record()
1608 rec->sak_len = (packed_record[5] >> 4) & 0x3; in get_egress_sc_record()
1610 rec->valid = (packed_record[7] >> 15) & 0x1; in get_egress_sc_record()
1631 return -EINVAL; in set_egress_sa_record()
1635 packed_record[0] = rec->start_time & 0xFFFF; in set_egress_sa_record()
1636 packed_record[1] = (rec->start_time >> 16) & 0xFFFF; in set_egress_sa_record()
1638 packed_record[2] = rec->stop_time & 0xFFFF; in set_egress_sa_record()
1639 packed_record[3] = (rec->stop_time >> 16) & 0xFFFF; in set_egress_sa_record()
1641 packed_record[4] = rec->next_pn & 0xFFFF; in set_egress_sa_record()
1642 packed_record[5] = (rec->next_pn >> 16) & 0xFFFF; in set_egress_sa_record()
1644 packed_record[6] = rec->sat_pn & 0x1; in set_egress_sa_record()
1646 packed_record[6] |= (rec->fresh & 0x1) << 1; in set_egress_sa_record()
1648 packed_record[7] = (rec->valid & 0x1) << 15; in set_egress_sa_record()
1673 return -EINVAL; in get_egress_sa_record()
1680 rec->start_time = packed_record[0]; in get_egress_sa_record()
1681 rec->start_time |= packed_record[1] << 16; in get_egress_sa_record()
1683 rec->stop_time = packed_record[2]; in get_egress_sa_record()
1684 rec->stop_time |= packed_record[3] << 16; in get_egress_sa_record()
1686 rec->next_pn = packed_record[4]; in get_egress_sa_record()
1687 rec->next_pn |= packed_record[5] << 16; in get_egress_sa_record()
1689 rec->sat_pn = packed_record[6] & 0x1; in get_egress_sa_record()
1691 rec->fresh = (packed_record[6] >> 1) & 0x1; in get_egress_sa_record()
1693 rec->valid = (packed_record[7] >> 15) & 0x1; in get_egress_sa_record()
1715 return -EINVAL; in set_egress_sakey_record()
1719 packed_record[0] = rec->key[0] & 0xFFFF; in set_egress_sakey_record()
1720 packed_record[1] = (rec->key[0] >> 16) & 0xFFFF; in set_egress_sakey_record()
1722 packed_record[2] = rec->key[1] & 0xFFFF; in set_egress_sakey_record()
1723 packed_record[3] = (rec->key[1] >> 16) & 0xFFFF; in set_egress_sakey_record()
1725 packed_record[4] = rec->key[2] & 0xFFFF; in set_egress_sakey_record()
1726 packed_record[5] = (rec->key[2] >> 16) & 0xFFFF; in set_egress_sakey_record()
1728 packed_record[6] = rec->key[3] & 0xFFFF; in set_egress_sakey_record()
1729 packed_record[7] = (rec->key[3] >> 16) & 0xFFFF; in set_egress_sakey_record()
1731 packed_record[8] = rec->key[4] & 0xFFFF; in set_egress_sakey_record()
1732 packed_record[9] = (rec->key[4] >> 16) & 0xFFFF; in set_egress_sakey_record()
1734 packed_record[10] = rec->key[5] & 0xFFFF; in set_egress_sakey_record()
1735 packed_record[11] = (rec->key[5] >> 16) & 0xFFFF; in set_egress_sakey_record()
1737 packed_record[12] = rec->key[6] & 0xFFFF; in set_egress_sakey_record()
1738 packed_record[13] = (rec->key[6] >> 16) & 0xFFFF; in set_egress_sakey_record()
1740 packed_record[14] = rec->key[7] & 0xFFFF; in set_egress_sakey_record()
1741 packed_record[15] = (rec->key[7] >> 16) & 0xFFFF; in set_egress_sakey_record()
1748 ROWOFFSET_EGRESSSAKEYRECORD + table_index - in set_egress_sakey_record()
1776 return -EINVAL; in get_egress_sakey_record()
1783 ROWOFFSET_EGRESSSAKEYRECORD + table_index - in get_egress_sakey_record()
1788 rec->key[0] = packed_record[0]; in get_egress_sakey_record()
1789 rec->key[0] |= packed_record[1] << 16; in get_egress_sakey_record()
1791 rec->key[1] = packed_record[2]; in get_egress_sakey_record()
1792 rec->key[1] |= packed_record[3] << 16; in get_egress_sakey_record()
1794 rec->key[2] = packed_record[4]; in get_egress_sakey_record()
1795 rec->key[2] |= packed_record[5] << 16; in get_egress_sakey_record()
1797 rec->key[3] = packed_record[6]; in get_egress_sakey_record()
1798 rec->key[3] |= packed_record[7] << 16; in get_egress_sakey_record()
1800 rec->key[4] = packed_record[8]; in get_egress_sakey_record()
1801 rec->key[4] |= packed_record[9] << 16; in get_egress_sakey_record()
1803 rec->key[5] = packed_record[10]; in get_egress_sakey_record()
1804 rec->key[5] |= packed_record[11] << 16; in get_egress_sakey_record()
1806 rec->key[6] = packed_record[12]; in get_egress_sakey_record()
1807 rec->key[6] |= packed_record[13] << 16; in get_egress_sakey_record()
1809 rec->key[7] = packed_record[14]; in get_egress_sakey_record()
1810 rec->key[7] |= packed_record[15] << 16; in get_egress_sakey_record()
1832 return -EINVAL; in get_egress_sc_counters()
1837 counters->sc_protected_pkts[0] = in get_egress_sc_counters()
1839 counters->sc_protected_pkts[1] = in get_egress_sc_counters()
1845 counters->sc_encrypted_pkts[0] = in get_egress_sc_counters()
1847 counters->sc_encrypted_pkts[1] = in get_egress_sc_counters()
1853 counters->sc_protected_octets[0] = in get_egress_sc_counters()
1855 counters->sc_protected_octets[1] = in get_egress_sc_counters()
1861 counters->sc_encrypted_octets[0] = in get_egress_sc_counters()
1863 counters->sc_encrypted_octets[1] = in get_egress_sc_counters()
1886 return -EINVAL; in get_egress_sa_counters()
1891 counters->sa_hit_drop_redirect[0] = in get_egress_sa_counters()
1893 counters->sa_hit_drop_redirect[1] = in get_egress_sa_counters()
1899 counters->sa_protected2_pkts[0] = in get_egress_sa_counters()
1901 counters->sa_protected2_pkts[1] = in get_egress_sa_counters()
1907 counters->sa_protected_pkts[0] = in get_egress_sa_counters()
1909 counters->sa_protected_pkts[1] = in get_egress_sa_counters()
1915 counters->sa_encrypted_pkts[0] = in get_egress_sa_counters()
1917 counters->sa_encrypted_pkts[1] = in get_egress_sa_counters()
1942 counters->ctl_pkt[0] = packed_record[0] | (packed_record[1] << 16); in get_egress_common_counters()
1943 counters->ctl_pkt[1] = packed_record[2] | (packed_record[3] << 16); in get_egress_common_counters()
1948 counters->unknown_sa_pkts[0] = in get_egress_common_counters()
1950 counters->unknown_sa_pkts[1] = in get_egress_common_counters()
1956 counters->untagged_pkts[0] = in get_egress_common_counters()
1958 counters->untagged_pkts[1] = in get_egress_common_counters()
1964 counters->too_long[0] = packed_record[0] | (packed_record[1] << 16); in get_egress_common_counters()
1965 counters->too_long[1] = packed_record[2] | (packed_record[3] << 16); in get_egress_common_counters()
1970 counters->ecc_error_pkts[0] = in get_egress_common_counters()
1972 counters->ecc_error_pkts[1] = in get_egress_common_counters()
1978 counters->unctrl_hit_drop_redir[0] = in get_egress_common_counters()
1980 counters->unctrl_hit_drop_redir[1] = in get_egress_common_counters()
2011 /* Toggle the Egress MIB clear bit 0->1->0 */ in clear_egress_counters()
2061 return -EINVAL; in get_ingress_sa_counters()
2067 counters->untagged_hit_pkts[0] = in get_ingress_sa_counters()
2069 counters->untagged_hit_pkts[1] = in get_ingress_sa_counters()
2076 counters->ctrl_hit_drop_redir_pkts[0] = in get_ingress_sa_counters()
2078 counters->ctrl_hit_drop_redir_pkts[1] = in get_ingress_sa_counters()
2085 counters->not_using_sa[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_sa_counters()
2086 counters->not_using_sa[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_sa_counters()
2092 counters->unused_sa[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_sa_counters()
2093 counters->unused_sa[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_sa_counters()
2099 counters->not_valid_pkts[0] = in get_ingress_sa_counters()
2101 counters->not_valid_pkts[1] = in get_ingress_sa_counters()
2108 counters->invalid_pkts[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_sa_counters()
2109 counters->invalid_pkts[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_sa_counters()
2115 counters->ok_pkts[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_sa_counters()
2116 counters->ok_pkts[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_sa_counters()
2122 counters->late_pkts[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_sa_counters()
2123 counters->late_pkts[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_sa_counters()
2129 counters->delayed_pkts[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_sa_counters()
2130 counters->delayed_pkts[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_sa_counters()
2136 counters->unchecked_pkts[0] = in get_ingress_sa_counters()
2138 counters->unchecked_pkts[1] = in get_ingress_sa_counters()
2145 counters->validated_octets[0] = in get_ingress_sa_counters()
2147 counters->validated_octets[1] = in get_ingress_sa_counters()
2154 counters->decrypted_octets[0] = in get_ingress_sa_counters()
2156 counters->decrypted_octets[1] = in get_ingress_sa_counters()
2182 counters->ctl_pkts[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_common_counters()
2183 counters->ctl_pkts[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_common_counters()
2188 counters->tagged_miss_pkts[0] = in get_ingress_common_counters()
2190 counters->tagged_miss_pkts[1] = in get_ingress_common_counters()
2196 counters->untagged_miss_pkts[0] = in get_ingress_common_counters()
2198 counters->untagged_miss_pkts[1] = in get_ingress_common_counters()
2204 counters->notag_pkts[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_common_counters()
2205 counters->notag_pkts[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_common_counters()
2210 counters->untagged_pkts[0] = in get_ingress_common_counters()
2212 counters->untagged_pkts[1] = in get_ingress_common_counters()
2218 counters->bad_tag_pkts[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_common_counters()
2219 counters->bad_tag_pkts[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_common_counters()
2224 counters->no_sci_pkts[0] = packed_record[0] | (packed_record[1] << 16); in get_ingress_common_counters()
2225 counters->no_sci_pkts[1] = packed_record[2] | (packed_record[3] << 16); in get_ingress_common_counters()
2230 counters->unknown_sci_pkts[0] = in get_ingress_common_counters()
2232 counters->unknown_sci_pkts[1] = in get_ingress_common_counters()
2238 counters->ctrl_prt_pass_pkts[0] = in get_ingress_common_counters()
2240 counters->ctrl_prt_pass_pkts[1] = in get_ingress_common_counters()
2246 counters->unctrl_prt_pass_pkts[0] = in get_ingress_common_counters()
2248 counters->unctrl_prt_pass_pkts[1] = in get_ingress_common_counters()
2254 counters->ctrl_prt_fail_pkts[0] = in get_ingress_common_counters()
2256 counters->ctrl_prt_fail_pkts[1] = in get_ingress_common_counters()
2262 counters->unctrl_prt_fail_pkts[0] = in get_ingress_common_counters()
2264 counters->unctrl_prt_fail_pkts[1] = in get_ingress_common_counters()
2270 counters->too_long_pkts[0] = in get_ingress_common_counters()
2272 counters->too_long_pkts[1] = in get_ingress_common_counters()
2278 counters->igpoc_ctl_pkts[0] = in get_ingress_common_counters()
2280 counters->igpoc_ctl_pkts[1] = in get_ingress_common_counters()
2286 counters->ecc_error_pkts[0] = in get_ingress_common_counters()
2288 counters->ecc_error_pkts[1] = in get_ingress_common_counters()
2294 counters->unctrl_hit_drop_redir[0] = in get_ingress_common_counters()
2296 counters->unctrl_hit_drop_redir[1] = in get_ingress_common_counters()
2327 /* Toggle the Ingress MIB clear bit 0->1->0 */ in clear_ingress_counters()