aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_cmds.h
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/benet/be_cmds.h
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/benet/be_cmds.h')
-rw-r--r--drivers/net/benet/be_cmds.h196
1 files changed, 188 insertions, 8 deletions
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index e5f9676cf1bc..cce61f9a3714 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2005 - 2009 ServerEngines 2 * Copyright (C) 2005 - 2010 ServerEngines
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -112,16 +112,19 @@ struct be_mcc_mailbox {
112 112
113#define CMD_SUBSYSTEM_COMMON 0x1 113#define CMD_SUBSYSTEM_COMMON 0x1
114#define CMD_SUBSYSTEM_ETH 0x3 114#define CMD_SUBSYSTEM_ETH 0x3
115#define CMD_SUBSYSTEM_LOWLEVEL 0xb
115 116
116#define OPCODE_COMMON_NTWK_MAC_QUERY 1 117#define OPCODE_COMMON_NTWK_MAC_QUERY 1
117#define OPCODE_COMMON_NTWK_MAC_SET 2 118#define OPCODE_COMMON_NTWK_MAC_SET 2
118#define OPCODE_COMMON_NTWK_MULTICAST_SET 3 119#define OPCODE_COMMON_NTWK_MULTICAST_SET 3
119#define OPCODE_COMMON_NTWK_VLAN_CONFIG 4 120#define OPCODE_COMMON_NTWK_VLAN_CONFIG 4
120#define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5 121#define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
122#define OPCODE_COMMON_READ_FLASHROM 6
121#define OPCODE_COMMON_WRITE_FLASHROM 7 123#define OPCODE_COMMON_WRITE_FLASHROM 7
122#define OPCODE_COMMON_CQ_CREATE 12 124#define OPCODE_COMMON_CQ_CREATE 12
123#define OPCODE_COMMON_EQ_CREATE 13 125#define OPCODE_COMMON_EQ_CREATE 13
124#define OPCODE_COMMON_MCC_CREATE 21 126#define OPCODE_COMMON_MCC_CREATE 21
127#define OPCODE_COMMON_SEEPROM_READ 30
125#define OPCODE_COMMON_NTWK_RX_FILTER 34 128#define OPCODE_COMMON_NTWK_RX_FILTER 34
126#define OPCODE_COMMON_GET_FW_VERSION 35 129#define OPCODE_COMMON_GET_FW_VERSION 35
127#define OPCODE_COMMON_SET_FLOW_CONTROL 36 130#define OPCODE_COMMON_SET_FLOW_CONTROL 36
@@ -138,6 +141,9 @@ struct be_mcc_mailbox {
138#define OPCODE_COMMON_NTWK_PMAC_ADD 59 141#define OPCODE_COMMON_NTWK_PMAC_ADD 59
139#define OPCODE_COMMON_NTWK_PMAC_DEL 60 142#define OPCODE_COMMON_NTWK_PMAC_DEL 60
140#define OPCODE_COMMON_FUNCTION_RESET 61 143#define OPCODE_COMMON_FUNCTION_RESET 61
144#define OPCODE_COMMON_ENABLE_DISABLE_BEACON 69
145#define OPCODE_COMMON_GET_BEACON_STATE 70
146#define OPCODE_COMMON_READ_TRANSRECV_DATA 73
141 147
142#define OPCODE_ETH_ACPI_CONFIG 2 148#define OPCODE_ETH_ACPI_CONFIG 2
143#define OPCODE_ETH_PROMISCUOUS 3 149#define OPCODE_ETH_PROMISCUOUS 3
@@ -146,6 +152,11 @@ struct be_mcc_mailbox {
146#define OPCODE_ETH_RX_CREATE 8 152#define OPCODE_ETH_RX_CREATE 8
147#define OPCODE_ETH_TX_DESTROY 9 153#define OPCODE_ETH_TX_DESTROY 9
148#define OPCODE_ETH_RX_DESTROY 10 154#define OPCODE_ETH_RX_DESTROY 10
155#define OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG 12
156
157#define OPCODE_LOWLEVEL_HOST_DDR_DMA 17
158#define OPCODE_LOWLEVEL_LOOPBACK_TEST 18
159#define OPCODE_LOWLEVEL_SET_LOOPBACK_MODE 19
149 160
150struct be_cmd_req_hdr { 161struct be_cmd_req_hdr {
151 u8 opcode; /* dword 0 */ 162 u8 opcode; /* dword 0 */
@@ -154,7 +165,8 @@ struct be_cmd_req_hdr {
154 u8 domain; /* dword 0 */ 165 u8 domain; /* dword 0 */
155 u32 timeout; /* dword 1 */ 166 u32 timeout; /* dword 1 */
156 u32 request_length; /* dword 2 */ 167 u32 request_length; /* dword 2 */
157 u32 rsvd; /* dword 3 */ 168 u8 version; /* dword 3 */
169 u8 rsvd[3]; /* dword 3 */
158}; 170};
159 171
160#define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */ 172#define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
@@ -435,7 +447,7 @@ enum be_if_flags {
435 * filtering capabilities. */ 447 * filtering capabilities. */
436struct be_cmd_req_if_create { 448struct be_cmd_req_if_create {
437 struct be_cmd_req_hdr hdr; 449 struct be_cmd_req_hdr hdr;
438 u32 version; /* ignore currntly */ 450 u32 version; /* ignore currently */
439 u32 capability_flags; 451 u32 capability_flags;
440 u32 enable_flags; 452 u32 enable_flags;
441 u8 mac_addr[ETH_ALEN]; 453 u8 mac_addr[ETH_ALEN];
@@ -587,6 +599,8 @@ struct be_cmd_req_promiscuous_config {
587 u16 rsvd0; 599 u16 rsvd0;
588} __packed; 600} __packed;
589 601
602/******************** Multicast MAC Config *******************/
603#define BE_MAX_MC 64 /* set mcast promisc if > 64 */
590struct macaddr { 604struct macaddr {
591 u8 byte[ETH_ALEN]; 605 u8 byte[ETH_ALEN];
592}; 606};
@@ -596,7 +610,7 @@ struct be_cmd_req_mcast_mac_config {
596 u16 num_mac; 610 u16 num_mac;
597 u8 promiscuous; 611 u8 promiscuous;
598 u8 interface_id; 612 u8 interface_id;
599 struct macaddr mac[32]; 613 struct macaddr mac[BE_MAX_MC];
600} __packed; 614} __packed;
601 615
602static inline struct be_hw_stats * 616static inline struct be_hw_stats *
@@ -633,9 +647,47 @@ struct be_cmd_resp_link_status {
633 u8 mac_fault; 647 u8 mac_fault;
634 u8 mgmt_mac_duplex; 648 u8 mgmt_mac_duplex;
635 u8 mgmt_mac_speed; 649 u8 mgmt_mac_speed;
636 u16 rsvd0; 650 u16 link_speed;
651 u32 rsvd0;
637} __packed; 652} __packed;
638 653
654/******************** Port Identification ***************************/
655/* Identifies the type of port attached to NIC */
656struct be_cmd_req_port_type {
657 struct be_cmd_req_hdr hdr;
658 u32 page_num;
659 u32 port;
660};
661
662enum {
663 TR_PAGE_A0 = 0xa0,
664 TR_PAGE_A2 = 0xa2
665};
666
667struct be_cmd_resp_port_type {
668 struct be_cmd_resp_hdr hdr;
669 u32 page_num;
670 u32 port;
671 struct data {
672 u8 identifier;
673 u8 identifier_ext;
674 u8 connector;
675 u8 transceiver[8];
676 u8 rsvd0[3];
677 u8 length_km;
678 u8 length_hm;
679 u8 length_om1;
680 u8 length_om2;
681 u8 length_cu;
682 u8 length_cu_m;
683 u8 vendor_name[16];
684 u8 rsvd;
685 u8 vendor_oui[3];
686 u8 vendor_pn[16];
687 u8 vendor_rev[4];
688 } data;
689};
690
639/******************** Get FW Version *******************/ 691/******************** Get FW Version *******************/
640struct be_cmd_req_get_fw_version { 692struct be_cmd_req_get_fw_version {
641 struct be_cmd_req_hdr hdr; 693 struct be_cmd_req_hdr hdr;
@@ -699,6 +751,37 @@ struct be_cmd_resp_query_fw_cfg {
699 u32 rsvd[26]; 751 u32 rsvd[26];
700}; 752};
701 753
754/******************** Port Beacon ***************************/
755
756#define BEACON_STATE_ENABLED 0x1
757#define BEACON_STATE_DISABLED 0x0
758
759struct be_cmd_req_enable_disable_beacon {
760 struct be_cmd_req_hdr hdr;
761 u8 port_num;
762 u8 beacon_state;
763 u8 beacon_duration;
764 u8 status_duration;
765} __packed;
766
767struct be_cmd_resp_enable_disable_beacon {
768 struct be_cmd_resp_hdr resp_hdr;
769 u32 rsvd0;
770} __packed;
771
772struct be_cmd_req_get_beacon_state {
773 struct be_cmd_req_hdr hdr;
774 u8 port_num;
775 u8 rsvd0;
776 u16 rsvd1;
777} __packed;
778
779struct be_cmd_resp_get_beacon_state {
780 struct be_cmd_resp_hdr resp_hdr;
781 u8 beacon_state;
782 u8 rsvd0[3];
783} __packed;
784
702/****************** Firmware Flash ******************/ 785/****************** Firmware Flash ******************/
703struct flashrom_params { 786struct flashrom_params {
704 u32 op_code; 787 u32 op_code;
@@ -713,6 +796,79 @@ struct be_cmd_write_flashrom {
713 struct flashrom_params params; 796 struct flashrom_params params;
714}; 797};
715 798
799/************************ WOL *******************************/
800struct be_cmd_req_acpi_wol_magic_config{
801 struct be_cmd_req_hdr hdr;
802 u32 rsvd0[145];
803 u8 magic_mac[6];
804 u8 rsvd2[2];
805} __packed;
806
807/********************** LoopBack test *********************/
808struct be_cmd_req_loopback_test {
809 struct be_cmd_req_hdr hdr;
810 u32 loopback_type;
811 u32 num_pkts;
812 u64 pattern;
813 u32 src_port;
814 u32 dest_port;
815 u32 pkt_size;
816};
817
818struct be_cmd_resp_loopback_test {
819 struct be_cmd_resp_hdr resp_hdr;
820 u32 status;
821 u32 num_txfer;
822 u32 num_rx;
823 u32 miscomp_off;
824 u32 ticks_compl;
825};
826
827struct be_cmd_req_set_lmode {
828 struct be_cmd_req_hdr hdr;
829 u8 src_port;
830 u8 dest_port;
831 u8 loopback_type;
832 u8 loopback_state;
833};
834
835struct be_cmd_resp_set_lmode {
836 struct be_cmd_resp_hdr resp_hdr;
837 u8 rsvd0[4];
838};
839
840/********************** DDR DMA test *********************/
841struct be_cmd_req_ddrdma_test {
842 struct be_cmd_req_hdr hdr;
843 u64 pattern;
844 u32 byte_count;
845 u32 rsvd0;
846 u8 snd_buff[4096];
847 u8 rsvd1[4096];
848};
849
850struct be_cmd_resp_ddrdma_test {
851 struct be_cmd_resp_hdr hdr;
852 u64 pattern;
853 u32 byte_cnt;
854 u32 snd_err;
855 u8 rsvd0[4096];
856 u8 rcv_buff[4096];
857};
858
859/*********************** SEEPROM Read ***********************/
860
861#define BE_READ_SEEPROM_LEN 1024
862struct be_cmd_req_seeprom_read {
863 struct be_cmd_req_hdr hdr;
864 u8 rsvd0[BE_READ_SEEPROM_LEN];
865};
866
867struct be_cmd_resp_seeprom_read {
868 struct be_cmd_req_hdr hdr;
869 u8 seeprom_data[BE_READ_SEEPROM_LEN];
870};
871
716extern int be_pci_fnum_get(struct be_adapter *adapter); 872extern int be_pci_fnum_get(struct be_adapter *adapter);
717extern int be_cmd_POST(struct be_adapter *adapter); 873extern int be_cmd_POST(struct be_adapter *adapter);
718extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, 874extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
@@ -743,7 +899,7 @@ extern int be_cmd_rxq_create(struct be_adapter *adapter,
743extern int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, 899extern int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
744 int type); 900 int type);
745extern int be_cmd_link_status_query(struct be_adapter *adapter, 901extern int be_cmd_link_status_query(struct be_adapter *adapter,
746 bool *link_up); 902 bool *link_up, u8 *mac_speed, u16 *link_speed);
747extern int be_cmd_reset(struct be_adapter *adapter); 903extern int be_cmd_reset(struct be_adapter *adapter);
748extern int be_cmd_get_stats(struct be_adapter *adapter, 904extern int be_cmd_get_stats(struct be_adapter *adapter,
749 struct be_dma_mem *nonemb_cmd); 905 struct be_dma_mem *nonemb_cmd);
@@ -756,7 +912,7 @@ extern int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id,
756extern int be_cmd_promiscuous_config(struct be_adapter *adapter, 912extern int be_cmd_promiscuous_config(struct be_adapter *adapter,
757 u8 port_num, bool en); 913 u8 port_num, bool en);
758extern int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id, 914extern int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id,
759 struct dev_mc_list *mc_list, u32 mc_count); 915 struct net_device *netdev, struct be_dma_mem *mem);
760extern int be_cmd_set_flow_control(struct be_adapter *adapter, 916extern int be_cmd_set_flow_control(struct be_adapter *adapter,
761 u32 tx_fc, u32 rx_fc); 917 u32 tx_fc, u32 rx_fc);
762extern int be_cmd_get_flow_control(struct be_adapter *adapter, 918extern int be_cmd_get_flow_control(struct be_adapter *adapter,
@@ -764,7 +920,31 @@ extern int be_cmd_get_flow_control(struct be_adapter *adapter,
764extern int be_cmd_query_fw_cfg(struct be_adapter *adapter, 920extern int be_cmd_query_fw_cfg(struct be_adapter *adapter,
765 u32 *port_num, u32 *cap); 921 u32 *port_num, u32 *cap);
766extern int be_cmd_reset_function(struct be_adapter *adapter); 922extern int be_cmd_reset_function(struct be_adapter *adapter);
767extern int be_process_mcc(struct be_adapter *adapter); 923extern int be_process_mcc(struct be_adapter *adapter, int *status);
924extern int be_cmd_set_beacon_state(struct be_adapter *adapter,
925 u8 port_num, u8 beacon, u8 status, u8 state);
926extern int be_cmd_get_beacon_state(struct be_adapter *adapter,
927 u8 port_num, u32 *state);
928extern int be_cmd_read_port_type(struct be_adapter *adapter, u32 port,
929 u8 *connector);
768extern int be_cmd_write_flashrom(struct be_adapter *adapter, 930extern int be_cmd_write_flashrom(struct be_adapter *adapter,
769 struct be_dma_mem *cmd, u32 flash_oper, 931 struct be_dma_mem *cmd, u32 flash_oper,
770 u32 flash_opcode, u32 buf_size); 932 u32 flash_opcode, u32 buf_size);
933int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
934 int offset);
935extern int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
936 struct be_dma_mem *nonemb_cmd);
937extern int be_cmd_fw_init(struct be_adapter *adapter);
938extern int be_cmd_fw_clean(struct be_adapter *adapter);
939extern void be_async_mcc_enable(struct be_adapter *adapter);
940extern void be_async_mcc_disable(struct be_adapter *adapter);
941extern int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
942 u32 loopback_type, u32 pkt_size,
943 u32 num_pkts, u64 pattern);
944extern int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern,
945 u32 byte_cnt, struct be_dma_mem *cmd);
946extern int be_cmd_get_seeprom_data(struct be_adapter *adapter,
947 struct be_dma_mem *nonemb_cmd);
948extern int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
949 u8 loopback_type, u8 enable);
950