~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/net/ixgbevf/vf.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
        return 0;
217
217
}
218
218
 
 
219
static s32 ixgbevf_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr)
 
220
{
 
221
        struct ixgbe_mbx_info *mbx = &hw->mbx;
 
222
        u32 msgbuf[3];
 
223
        u8 *msg_addr = (u8 *)(&msgbuf[1]);
 
224
        s32 ret_val;
 
225
 
 
226
        memset(msgbuf, 0, sizeof(msgbuf));
 
227
        /*
 
228
         * If index is one then this is the start of a new list and needs
 
229
         * indication to the PF so it can do it's own list management.
 
230
         * If it is zero then that tells the PF to just clear all of
 
231
         * this VF's macvlans and there is no new list.
 
232
         */
 
233
        msgbuf[0] |= index << IXGBE_VT_MSGINFO_SHIFT;
 
234
        msgbuf[0] |= IXGBE_VF_SET_MACVLAN;
 
235
        if (addr)
 
236
                memcpy(msg_addr, addr, 6);
 
237
        ret_val = mbx->ops.write_posted(hw, msgbuf, 3);
 
238
 
 
239
        if (!ret_val)
 
240
                ret_val = mbx->ops.read_posted(hw, msgbuf, 3);
 
241
 
 
242
        msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS;
 
243
 
 
244
        if (!ret_val)
 
245
                if (msgbuf[0] ==
 
246
                    (IXGBE_VF_SET_MACVLAN | IXGBE_VT_MSGTYPE_NACK))
 
247
                        ret_val = -ENOMEM;
 
248
 
 
249
        return ret_val;
 
250
}
 
251
 
219
252
/**
220
253
 *  ixgbevf_set_rar_vf - set device MAC address
221
254
 *  @hw: pointer to hardware structure
378
411
        .check_link          = ixgbevf_check_mac_link_vf,
379
412
        .set_rar             = ixgbevf_set_rar_vf,
380
413
        .update_mc_addr_list = ixgbevf_update_mc_addr_list_vf,
 
414
        .set_uc_addr         = ixgbevf_set_uc_addr_vf,
381
415
        .set_vfta            = ixgbevf_set_vfta_vf,
382
416
};
383
417