~ubuntu-branches/debian/sid/ipmitool/sid

« back to all changes in this revision

Viewing changes to lib/ipmi_event.c

  • Committer: Package Import Robot
  • Author(s): Luk Claes
  • Date: 2013-05-07 18:12:12 UTC
  • mfrom: (5.1.11 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130507181212-fitwelheknk3tqnq
Tags: 1.8.12-1
Merge new upstream from Ubuntu (Closes: #692292).

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
        if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) {
98
98
                /* system interface, need extra generator ID */
99
99
                req.msg.data_len = 8;
100
 
                rqdata[0] = 0x20;
 
100
                rqdata[0] = 0x41;   // As per Fig. 29-2 and Table 5-4
101
101
                memcpy(rqdata+1, emsg, sizeof(struct platform_event_msg));
102
102
        }
103
103
        else {
227
227
static void
228
228
print_sensor_states(uint8_t sensor_type, uint8_t event_type)
229
229
{
230
 
        printf("Sensor States: \n  ");
231
 
        ipmi_sdr_print_discrete_state_mini("\n  ", sensor_type,
 
230
        ipmi_sdr_print_discrete_state_mini(
 
231
                        "Sensor States: \n  ", "\n  ", sensor_type,
232
232
                                           event_type, 0xff, 0xff);
233
233
        printf("\n");
234
234
}
241
241
        struct sdr_record_list * sdr;
242
242
        struct platform_event_msg emsg;
243
243
        int off;
244
 
        uint8_t target, lun;
 
244
        uint8_t target, lun, channel;
245
245
 
246
246
        if (id == NULL) {
247
247
                lprintf(LOG_ERR, "No sensor ID supplied");
273
273
        switch (sdr->type)
274
274
        {
275
275
        case SDR_RECORD_TYPE_FULL_SENSOR:
276
 
 
277
 
                emsg.sensor_type   = sdr->record.full->sensor.type;
278
 
                emsg.sensor_num    = sdr->record.full->keys.sensor_num;
279
 
                emsg.event_type    = sdr->record.full->event_type;
280
 
                target    = sdr->record.full->keys.owner_id;
281
 
                lun    = sdr->record.full->keys.lun;
282
 
                break;
283
 
 
284
276
        case SDR_RECORD_TYPE_COMPACT_SENSOR:
285
277
 
286
 
                emsg.sensor_type = sdr->record.compact->sensor.type;
287
 
                emsg.sensor_num  = sdr->record.compact->keys.sensor_num;
288
 
                emsg.event_type  = sdr->record.compact->event_type;
289
 
                target    = sdr->record.compact->keys.owner_id;
290
 
                lun    = sdr->record.compact->keys.lun;
 
278
                emsg.sensor_type   = sdr->record.common->sensor.type;
 
279
                emsg.sensor_num    = sdr->record.common->keys.sensor_num;
 
280
                emsg.event_type    = sdr->record.common->event_type;
 
281
                target    = sdr->record.common->keys.owner_id;
 
282
                lun    = sdr->record.common->keys.lun;
 
283
                channel = sdr->record.common->keys.channel;
291
284
                break;
292
 
 
293
285
        default:
294
286
                lprintf(LOG_ERR, "Unknown sensor type for id '%s'", id);
295
287
                return -1;
353
345
                }
354
346
 
355
347
                rsp = ipmi_sdr_get_sensor_thresholds(intf, emsg.sensor_num,
356
 
                                                        target, lun);
 
348
                                                        target, lun, channel);
357
349
 
358
350
                if (rsp != NULL && rsp->ccode == 0) {
359
351
 
361
353
                        emsg.event_data[2] = rsp->data[(emsg.event_data[0] / 2) + 1];
362
354
 
363
355
                        rsp = ipmi_sdr_get_sensor_hysteresis(intf, emsg.sensor_num,
364
 
                                                                target, lun);
 
356
                                                                target, lun, channel);
365
357
                        if (rsp != NULL && rsp->ccode == 0)
366
358
                                off = dir ? rsp->data[0] : rsp->data[1];
367
359
                        if (off <= 0)
509
501
        chmed = ipmi_current_channel_medium(intf);
510
502
        if (chmed == IPMI_CHANNEL_MEDIUM_SYSTEM) {
511
503
                /* system interface, need extra generator ID */
512
 
                rqdata[0] = 0x20;
 
504
                rqdata[0] = 0x41;   // As per Fig. 29-2 and Table 5-4
513
505
                req.msg.data_len = 8;
514
506
        }
515
507