~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to drivers/net/sfc/boards.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
{
27
27
        struct efx_nic *efx = (struct efx_nic *)context;
28
28
        struct efx_blinker *bl = &efx->board_info.blinker;
29
 
        efx->board_info.set_fault_led(efx, bl->state);
 
29
        efx->board_info.set_id_led(efx, bl->state);
30
30
        bl->state = !bl->state;
31
31
        if (bl->resubmit)
32
32
                mod_timer(&bl->timer, jiffies + BLINK_INTERVAL);
48
48
                blinker->resubmit = false;
49
49
                if (blinker->timer.function)
50
50
                        del_timer_sync(&blinker->timer);
51
 
                efx->board_info.set_fault_led(efx, false);
 
51
                efx->board_info.init_leds(efx);
52
52
        }
53
53
}
54
54
 
172
172
static struct i2c_board_info sfe4002_hwmon_info = {
173
173
        I2C_BOARD_INFO("lm87", 0x2e),
174
174
        .platform_data  = &sfe4002_lm87_channel,
175
 
        .irq            = -1,
176
175
};
177
176
 
178
177
/****************************************************************************/
185
184
#define SFE4002_RX_LED    (0)   /* Green */
186
185
#define SFE4002_TX_LED    (1)   /* Amber */
187
186
 
188
 
static int sfe4002_init_leds(struct efx_nic *efx)
 
187
static void sfe4002_init_leds(struct efx_nic *efx)
189
188
{
190
189
        /* Set the TX and RX LEDs to reflect status and activity, and the
191
190
         * fault LED off */
194
193
        xfp_set_led(efx, SFE4002_RX_LED,
195
194
                    QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACTSTAT);
196
195
        xfp_set_led(efx, SFE4002_FAULT_LED, QUAKE_LED_OFF);
197
 
        efx->board_info.blinker.led_num = SFE4002_FAULT_LED;
198
 
        return 0;
199
196
}
200
197
 
201
 
static void sfe4002_fault_led(struct efx_nic *efx, bool state)
 
198
static void sfe4002_set_id_led(struct efx_nic *efx, bool state)
202
199
{
203
200
        xfp_set_led(efx, SFE4002_FAULT_LED, state ? QUAKE_LED_ON :
204
201
                        QUAKE_LED_OFF);
222
219
                return rc;
223
220
        efx->board_info.monitor = sfe4002_check_hw;
224
221
        efx->board_info.init_leds = sfe4002_init_leds;
225
 
        efx->board_info.set_fault_led = sfe4002_fault_led;
 
222
        efx->board_info.set_id_led = sfe4002_set_id_led;
 
223
        efx->board_info.blink = board_blink;
 
224
        efx->board_info.fini = efx_fini_lm87;
 
225
        return 0;
 
226
}
 
227
 
 
228
/*****************************************************************************
 
229
 * Support for the SFN4112F
 
230
 *
 
231
 */
 
232
static u8 sfn4112f_lm87_channel = 0x03; /* use AIN not FAN inputs */
 
233
 
 
234
static const u8 sfn4112f_lm87_regs[] = {
 
235
        LM87_IN_LIMITS(0, 0x83, 0x91),          /* 2.5V:  1.8V +/- 5% */
 
236
        LM87_IN_LIMITS(1, 0x51, 0x5a),          /* Vccp1: 1.2V +/- 5% */
 
237
        LM87_IN_LIMITS(2, 0xb6, 0xca),          /* 3.3V:  3.3V +/- 5% */
 
238
        LM87_IN_LIMITS(4, 0xb0, 0xe0),          /* 12V:   11-14V */
 
239
        LM87_IN_LIMITS(5, 0x44, 0x4b),          /* Vccp2: 1.0V +/- 5% */
 
240
        LM87_AIN_LIMITS(1, 0x91, 0xa1),         /* AIN2:  1.5V +/- 5% */
 
241
        LM87_TEMP_INT_LIMITS(10, 60),           /* board */
 
242
        LM87_TEMP_EXT1_LIMITS(10, 70),          /* Falcon */
 
243
        0
 
244
};
 
245
 
 
246
static struct i2c_board_info sfn4112f_hwmon_info = {
 
247
        I2C_BOARD_INFO("lm87", 0x2e),
 
248
        .platform_data  = &sfn4112f_lm87_channel,
 
249
};
 
250
 
 
251
#define SFN4112F_ACT_LED        0
 
252
#define SFN4112F_LINK_LED       1
 
253
 
 
254
static void sfn4112f_init_leds(struct efx_nic *efx)
 
255
{
 
256
        xfp_set_led(efx, SFN4112F_ACT_LED,
 
257
                    QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACT);
 
258
        xfp_set_led(efx, SFN4112F_LINK_LED,
 
259
                    QUAKE_LED_RXLINK | QUAKE_LED_LINK_STAT);
 
260
}
 
261
 
 
262
static void sfn4112f_set_id_led(struct efx_nic *efx, bool state)
 
263
{
 
264
        xfp_set_led(efx, SFN4112F_LINK_LED,
 
265
                    state ? QUAKE_LED_ON : QUAKE_LED_OFF);
 
266
}
 
267
 
 
268
static int sfn4112f_check_hw(struct efx_nic *efx)
 
269
{
 
270
        /* Mask out unused sensors */
 
271
        return efx_check_lm87(efx, ~0x48);
 
272
}
 
273
 
 
274
static int sfn4112f_init(struct efx_nic *efx)
 
275
{
 
276
        int rc = efx_init_lm87(efx, &sfn4112f_hwmon_info, sfn4112f_lm87_regs);
 
277
        if (rc)
 
278
                return rc;
 
279
        efx->board_info.monitor = sfn4112f_check_hw;
 
280
        efx->board_info.init_leds = sfn4112f_init_leds;
 
281
        efx->board_info.set_id_led = sfn4112f_set_id_led;
226
282
        efx->board_info.blink = board_blink;
227
283
        efx->board_info.fini = efx_fini_lm87;
228
284
        return 0;
243
299
        { EFX_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init },
244
300
        { EFX_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter",
245
301
          sfn4111t_init },
 
302
        { EFX_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter",
 
303
          sfn4112f_init },
246
304
};
247
305
 
248
306
void efx_set_board_info(struct efx_nic *efx, u16 revision_info)