Changeset 3471d3d in rtems


Ignore:
Timestamp:
Aug 22, 2017, 8:32:25 AM (2 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
master
Children:
1ccce05
Parents:
6b339b5
git-author:
Daniel Hellstrom <daniel@…> (08/22/17 08:32:25)
git-committer:
Daniel Hellstrom <daniel@…> (08/29/17 06:31:19)
Message:

leon,occan: remove dead code.

Fixes #2878

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/can/occan.c

    r6b339b5 r3471d3d  
    262262static int occan_calc_speedregs(unsigned int clock_hz, unsigned int rate, occan_speed_regs *result);
    263263static int occan_set_speedregs(occan_priv *priv, occan_speed_regs *timing);
    264 static int pelican_speed_auto(occan_priv *priv);
    265264static void pelican_init(occan_priv *priv);
    266265static void pelican_open(occan_priv *priv);
     
    10981097}
    10991098
    1100 #if 0
    1101 static unsigned int pelican_speed_auto_steplist [] = {
    1102         OCCAN_SPEED_500K,
    1103         OCCAN_SPEED_250K,
    1104         OCCAN_SPEED_125K,
    1105         OCCAN_SPEED_75K,
    1106         OCCAN_SPEED_50K,
    1107         OCCAN_SPEED_25K,
    1108         OCCAN_SPEED_10K,
    1109         0
    1110 };
    1111 #endif
    1112 
    1113 static int pelican_speed_auto(occan_priv *priv){
    1114         return -1;
    1115 
    1116 #if 0
    1117         int i=0;
    1118         occan_speed_regs timing;
    1119         unsigned int speed;
    1120         unsigned char tmp;
    1121 
    1122         while ( (speed=pelican_speed_auto_steplist[i]) > 0){
    1123 
    1124                 /* Reset core */
    1125                 WRITE_REG(priv, &priv->regs->mode, PELICAN_MOD_RESET);
    1126 
    1127                 /* tell int handler about the auto speed detection test */
    1128 
    1129 
    1130                 /* wait for a moment (10ms) */
    1131                 /*usleep(10000);*/
    1132 
    1133                 /* No acceptance filter */
    1134                 pelican_set_accept(priv);
    1135 
    1136                 /* calc timing params for this */
    1137                 if ( occan_calc_speedregs(priv->sys_freq_hz,speed,&timing) ){
    1138                         /* failed to get good timings for this frequency
    1139                          * test with next
    1140                          */
    1141                          continue;
    1142                 }
    1143 
    1144                 timing.sam = 0;
    1145 
    1146                 /* set timing params for this speed */
    1147                 occan_set_speedregs(priv,&timing);
    1148 
    1149                 /* Empty previous messages in hardware RX fifo */
    1150                 /*
    1151                 while( READ_REG(priv, &priv->regs->) ){
    1152 
    1153                 }
    1154                 */
    1155 
    1156                 /* Clear pending interrupts */
    1157                 tmp = READ_REG(priv, &priv->regs->intflags);
    1158 
    1159                 /* enable RX & ERR interrupt */
    1160                 priv->regs->inten =
    1161 
    1162                 /* Get out of reset state */
    1163                 priv->regs->mode = PELICAN_MOD_LISTEN;
    1164 
    1165                 /* wait for frames or errors */
    1166                 while(1){
    1167                         /* sleep 10ms */
    1168 
    1169                 }
    1170 
    1171         }
    1172 #endif
    1173 }
    1174 
    11751099static rtems_device_driver occan_initialize(rtems_device_major_number major, rtems_device_minor_number unused, void *arg)
    11761100{
     
    15861510                case OCCAN_IOC_SPEED_AUTO:
    15871511                        return RTEMS_NOT_IMPLEMENTED;
    1588                         if ( can->started )
    1589                                 return RTEMS_RESOURCE_IN_USE; /* EBUSY */
    1590 
    1591                         if ( (speed=pelican_speed_auto(can)) < 0 ){
    1592                                 /* failed */
    1593                                 return RTEMS_IO_ERROR;
    1594                         }
    1595 
    1596                         /* set new speed */
    1597                         can->speed = speed;
    1598 
    1599                         if ( (int *)ioarg->buffer ){
    1600                                 *(int *)ioarg->buffer = speed;
    1601                         }
    1602                         return RTEMS_SUCCESSFUL;
    1603                         break;
    16041512
    16051513                case OCCAN_IOC_SET_BUFLEN:
Note: See TracChangeset for help on using the changeset viewer.