/* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file hal/phy/maximus/test/src/test_phy_maximus.c * \brief HAL Phy main test function for Maximus. * \ingroup hal_phy_maximus */ #include "common/std.h" #include "lib/test.h" #include "host/station.h" #include // for 'open()' and 'close()' #include // for 'open()' and 'close()' void bridgedma_test_suite (test_t t); void pbdma_test_suite (test_t t); void phy_access_test_suite (test_t t); void phy_ctrl_test_suite (test_t t); void tmdma_test_suite (test_t t); uint32_t maximus_pending_isrs; station_ctx_t my_station; bool phy_rx_fc_cb (void *user, u32 rx_date, const u32 *fc_av) { return true; } bool phy_access_cb (void *user) { return true; } bool phy_access_conf_cb (void *user) { return true; } bool phy_pbdma_cb (void *user, u32 status_word) { return true; } bool phy_tx_false_alarm_cb (void *user) { return true; } bool phy_zero_cross_cb (void *user, const u32 zero_cross_date) { return true; } void phy_deferred_cb (void *user) { return; } bool phy_extra_timer_cb (void *user) { return true; } int maximus_phy_open (station_ctx_t *station) { int fd; #ifdef STATION_SOCK fd = station->sock_pair_fd; #else /* STATION_SOCK */ fd = open(station->pipe_out_name, O_RDONLY); #endif /* STATION_SOCK */ return fd; } void maximus_phy_close (int fd) { #ifndef STATION_SOCK close(fd); #endif /* !STATION_SOCK */ } int main (int argc, char **argv) { test_t t; test_init(t, argc, argv); bridgedma_test_suite(t); pbdma_test_suite(t); phy_access_test_suite(t); phy_ctrl_test_suite(t); tmdma_test_suite(t); test_result(t); return test_nb_failed(t) == 0 ? 0 : 1; }