]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blobdiff - rpp-test-sw/commands/cmd_netstats.c
Test software functionality temporarily reduced for SCI peripheral only
[pes-rpp/rpp-test-sw.git] / rpp-test-sw / commands / cmd_netstats.c
index 67ca818a0f0378c627abde0bff9cebf8061eedd0..924e546bd2028561161a26be804f0ce3777af913 100644 (file)
@@ -6,18 +6,10 @@
  * Authors:
  *     - Jan Dolezal <pm.jenik@gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * This document contains proprietary information belonging to Czech
+ * Technical University in Prague. Passing on and copying of this
+ * document, and communication of its contents is not permitted
+ * without prior written authorization.
  *
  * File : cmd_netstats.c
  *
@@ -61,7 +53,7 @@ int cmd_do_read_mac(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
        }
        uint8_t macaddr[18];
        rpp_eth_get_macAddrStr(INTERFACE_INSTANCE_NUMBER,macaddr);
-       rpp_sci_printf((const char*)"%s\n", macaddr);
+       rpp_sci_printf((const char *)"%s\n", macaddr);
        return SUCCESS;
 }
 
@@ -122,7 +114,7 @@ uint32_t bd_addr(uint16_t bd_num)
        return EMAC_CTRL_RAM_BASE_m(0) + bd_num*sizeof(struct emac_tx_bd);
 }
 
-volatile struct emac_tx_bd*findPreviousBD(volatile struct emac_tx_bd *bufferDescriptor)
+volatile struct emac_tx_bd *findPreviousBD(volatile struct emac_tx_bd *bufferDescriptor)
 {
        volatile struct emac_tx_bd *temporary = bufferDescriptor - 1;
 
@@ -135,9 +127,9 @@ volatile struct emac_tx_bd*findPreviousBD(volatile struct emac_tx_bd *bufferDesc
                        return temporary;
                temporary = (temporary + 1); /* going through memory, if you want to go through bd chains put here 'temporary = temporary->next;' */
                if ( (uint32_t)(temporary+1) > EMAC_CTRL_RAM_BASE_m(0)+SIZE_EMAC_CTRL_RAM) /* when out of CPPI RAM */
-                       temporary = (struct emac_tx_bd*)EMAC_CTRL_RAM_BASE_m(0);   /* continue scanning from the beginning */
+                       temporary = (struct emac_tx_bd *)EMAC_CTRL_RAM_BASE_m(0);  /* continue scanning from the beginning */
        }
-       return (struct emac_tx_bd*)-1;  /* not found */
+       return (struct emac_tx_bd *)-1;  /* not found */
 }
 
 void print_bd_content(volatile struct emac_tx_bd *bufferDescriptor, boolean_t humanReadable)
@@ -165,7 +157,7 @@ void print_bd_content(volatile struct emac_tx_bd *bufferDescriptor, boolean_t hu
  */
 void print_bds_state(uint8_t mode, uint8_t param)
 {
-       volatile struct emac_tx_bd *bufferDescriptor = (struct emac_tx_bd*)EMAC_CTRL_RAM_BASE_m(0);
+       volatile struct emac_tx_bd *bufferDescriptor = (struct emac_tx_bd *)EMAC_CTRL_RAM_BASE_m(0);
        uint16_t index = 0;
 
        rpp_sci_printf("TX:");
@@ -261,24 +253,24 @@ int cmd_do_bufferdescriptors(cmd_io_t *cmd_io, const struct cmd_des *des, char *
 
        /* examine parameters */
        for (pindex = 1; param[pindex] != 0; pindex++) {
-               if        (strncmp((char*)param[pindex], "-i", 3) == 0) {
+               if        (strncmp((char *)param[pindex], "-i", 3) == 0) {
                        interactive = TRUE;
                        break;
                }
-               else if (strncmp((char*)param[pindex], "-o", 3) == 0) {
+               else if (strncmp((char *)param[pindex], "-o", 3) == 0) {
                        overview = TRUE;
                        break;
                }
 #if RPP_ETH_STATS
-               else if (strncmp((char*)param[pindex], "-r", 3) == 0) {
+               else if (strncmp((char *)param[pindex], "-r", 3) == 0) {
                        isrRun = TRUE;
                        break;
                }
-               else if (strncmp((char*)param[pindex], "-rb", 4) == 0) {
+               else if (strncmp((char *)param[pindex], "-rb", 4) == 0) {
                        rb = TRUE;
                        break;
                }
-               else if (strncmp((char*)param[pindex], "-tb", 4) == 0) {
+               else if (strncmp((char *)param[pindex], "-tb", 4) == 0) {
                        tb = TRUE;
                        break;
                }
@@ -296,7 +288,7 @@ int cmd_do_bufferdescriptors(cmd_io_t *cmd_io, const struct cmd_des *des, char *
 
                        if (input == 'b') { /* print buffer descriptor at given address */
                                rpp_sci_printf("-? 0x");
-                               bufferDescriptor = (struct emac_tx_bd*)readNum(8,8,TRUE);
+                               bufferDescriptor = (struct emac_tx_bd *)readNum(8,8,TRUE);
                                rpp_sci_printf("\n");
                                /* check it fits EMAC CPPI RAM */
                                /*if(bufferDescriptor >= EMAC_CTRL_RAM_BASE_m(INTERFACE_INSTANCE_NUMBER) && (bufferDescriptor + sizeof(struct emac_tx_bd)) <= EMAC_CTRL_RAM_BASE_m(INTERFACE_INSTANCE_NUMBER) + SIZE_EMAC_CTRL_RAM)
@@ -494,7 +486,7 @@ cmd_des_t const cmd_des_linkstat = {
        "\n"
        "    --> ethlinkstat\n"
        "    et0 : DOWN\n",
-       CMD_HANDLER(cmd_do_read_linkstat), (void*)&cmd_list_netstats
+       CMD_HANDLER(cmd_do_read_linkstat), (void *)&cmd_list_netstats
 };
 
 cmd_des_t const cmd_des_mac = {
@@ -514,7 +506,7 @@ cmd_des_t const cmd_des_mac = {
        "\n"
        "    --> ethmac\n"
        "    12:34:56:78:9a:bc\n",
-       CMD_HANDLER(cmd_do_read_mac), (void*)&cmd_list_netstats
+       CMD_HANDLER(cmd_do_read_mac), (void *)&cmd_list_netstats
 };
 
 cmd_des_t const cmd_des_ip = {
@@ -536,7 +528,7 @@ cmd_des_t const cmd_des_ip = {
        "    Address: 192.168.247.1\n"
        "    Netmask: 255.255.255.0\n"
        "    Gateway: 192.168.247.255\n",
-       CMD_HANDLER(cmd_do_read_ip), (void*)&cmd_list_netstats
+       CMD_HANDLER(cmd_do_read_ip), (void *)&cmd_list_netstats
 };
 
 cmd_des_t const cmd_des_bufferdescriptors = {
@@ -561,7 +553,7 @@ cmd_des_t const cmd_des_bufferdescriptors = {
        "### Example ###\n"
        "\n"
        "    --> ethbd\n",
-       CMD_HANDLER(cmd_do_bufferdescriptors), (void*)&cmd_list_netstats
+       CMD_HANDLER(cmd_do_bufferdescriptors), (void *)&cmd_list_netstats
 };
 
 #if LWIP_DHCP
@@ -582,7 +574,7 @@ cmd_des_t const cmd_des_dhcp = {
        "\n"
        "    --> dhcp\n"
        "    \n",
-       CMD_HANDLER(cmd_do_dhcp), (void*)&cmd_list_netstats
+       CMD_HANDLER(cmd_do_dhcp), (void *)&cmd_list_netstats
 };
 #endif
 
@@ -621,7 +613,7 @@ cmd_des_t const cmd_des_lwip = {
        ".\n"
        "Shown sections depends on modules compiled in.\n"
        "    \n",
-       CMD_HANDLER(cmd_do_lwip), (void*)&cmd_list_netstats
+       CMD_HANDLER(cmd_do_lwip), (void *)&cmd_list_netstats
 };
 #endif /* if LWIP_STATS_DISPLAY */
 
@@ -641,7 +633,7 @@ cmd_des_t const cmd_des_ethinit = {
        "\n"
        "    --> ethinit\n"
        "    \n",
-       CMD_HANDLER(cmd_do_ethinit), (void*)&cmd_list_netstats
+       CMD_HANDLER(cmd_do_ethinit), (void *)&cmd_list_netstats
 };
 
 /** List of commands for lwip, defined as external */