3 * Copyright 2007,2008 Free Software Foundation, Inc.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef INCLUDED_APP_COMMON_H
20 #define INCLUDED_APP_COMMON_H
23 #include "usrp2_eth_packet.h"
25 #include "memory_map.h"
30 #define CPU_TX_BUF 7 // cpu -> eth
32 #define _AL4 __attribute__((aligned (4)))
34 extern volatile bool link_is_up; // eth handler sets this
36 // If there's a dbsm that sends to the ethernet, put it's address here
37 extern dbsm_t *ac_could_be_sending_to_eth;
39 extern int cpu_tx_buf_dest_port;
41 void set_reply_hdr(u2_eth_packet_t *reply_pkt, u2_eth_packet_t const *cmd_pkt);
44 * Called when an ethernet packet is received.
46 int eth_pkt_inspector(bsm12_t *sm, int bufno);
49 void link_changed_callback(int speed);
52 print_tune_result(char *msg, bool tune_ok,
53 u2_fxpt_freq_t target_freq, struct tune_result *r);
56 void start_rx_streaming_cmd(const u2_mac_addr_t *host, op_start_rx_streaming_t *p);
57 void stop_rx_cmd(void);
58 void restart_streaming(void);
59 bool is_streaming(void);
61 void handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len);
63 #endif /* INCLUDED_APP_COMMON_H */