~ubuntu-branches/ubuntu/vivid/openipmi/vivid

« back to all changes in this revision

Viewing changes to lib/oem_atca_conn.c

  • Committer: Bazaar Package Importer
  • Author(s): Noèl Köthe
  • Date: 2006-09-15 17:56:24 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060915175624-ljk0mg3xtcm65tvm
Tags: 2.0.7-1
* new upstream release from 2006-06-08
  Thanks to John Wright <john.wright hp.com> for initial work
  (closes: Bug#380149)
* updated Standards Version
* new binaries openipmicmd, openipmish, rmcp_ping

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    ipmi_msg_t           *msg = &rspi->msg;
53
53
    ipmi_ll_ipmb_addr_cb handler = rspi->data1;
54
54
    void                 *cb_data = rspi->data2;
55
 
    unsigned char        ipmb = 0;
 
55
    unsigned char        ipmb[MAX_IPMI_USED_CHANNELS];
56
56
    int                  err = 0;
57
57
    atca_conn_info_t     *info;
58
58
 
59
59
    if (!ipmi) {
60
60
        if (handler)
61
 
            handler(ipmi, ECANCELED, ipmb, 1, 0, cb_data);
 
61
            handler(ipmi, ECANCELED, ipmb, 1, 1, 0, cb_data);
62
62
        return IPMI_MSG_ITEM_NOT_USED;
63
63
    }
64
64
 
65
65
    info = ipmi->oem_data;
66
66
 
 
67
    memset(ipmb, 0, sizeof(*ipmb));
 
68
 
67
69
    if (msg->data[0] != 0) 
68
70
        err = IPMI_IPMI_ERR_VAL(msg->data[0]);
69
71
    else if (msg->data_len < 4)
70
72
        err = EINVAL;
71
73
    else if ((msg->data[7] == 3) && (!info->dont_use_floating_addr))
72
 
        ipmb = 0x20; /* This is a Dedicated ShMC and we are not doing
73
 
                        dual-ShMC addressing. */
 
74
        ipmb[0] = 0x20; /* This is a Dedicated ShMC and we are not doing
 
75
                           dual-ShMC addressing. */
74
76
    else
75
 
        ipmb = msg->data[3];
 
77
        ipmb[0] = msg->data[3];
76
78
 
77
79
    /* Note that there is no "inactive" connection with ATCA. */
78
80
    if (!err)
79
 
        ipmi->set_ipmb_addr(ipmi, ipmb, 1, info->hacks);
 
81
        ipmi->set_ipmb_addr(ipmi, ipmb, 1, 1, info->hacks);
80
82
 
81
83
    if (handler)
82
 
        handler(ipmi, err, ipmb, 1, info->hacks, cb_data);
 
84
        handler(ipmi, err, ipmb, 1, 1, info->hacks, cb_data);
83
85
    return IPMI_MSG_ITEM_NOT_USED;
84
86
}
85
87
 
133
135
    ipmi_conn_oem_check_done done = rspi->data1;
134
136
    void                     *cb_data = rspi->data2;
135
137
 
136
 
    if (ipmi && (msg->data_len >= 8) && (msg->data[0] == 0)) {
 
138
    if (ipmi && !ipmi->oem_data && (msg->data_len >= 8) && (msg->data[0] == 0))
 
139
    {
137
140
        atca_conn_info_t *info;
138
141
 
139
142
        info = ipmi_mem_alloc(sizeof(*info));
200
203
{
201
204
    atca_conn_info_t *info = conn->oem_data;
202
205
 
 
206
    if (!info)
 
207
        return 0;
 
208
 
203
209
    /* This means that we don't advertise 0x20 as our address on the
204
210
       CMM, we use the real address. */
205
211
#if 0
223
229
    if (rv)
224
230
        return rv;
225
231
 
 
232
    rv = ipmi_register_oem_conn_handler(0x000157, 0x080b,
 
233
                                        handle_intel_atca, NULL);
 
234
    if (rv)
 
235
        return rv;
 
236
 
 
237
    rv = ipmi_register_oem_conn_handler(0x000157, 0x080c,
 
238
                                        handle_intel_atca, NULL);
 
239
    if (rv)
 
240
        return rv;
 
241
 
226
242
    return 0;
227
243
}
228
244
 
231
247
{
232
248
    ipmi_deregister_conn_oem_check(atca_oem_check, NULL);
233
249
    ipmi_deregister_oem_conn_handler(0x000157, 0x0841);
 
250
    ipmi_deregister_oem_conn_handler(0x000157, 0x080c);
 
251
    ipmi_deregister_oem_conn_handler(0x000157, 0x080b);
234
252
}