qed* : Add new TLV to request PF to update MAC in bulletin board
[linux-2.6-microblaze.git] / drivers / net / ethernet / qlogic / qed / qed_vf.c
index 91b5e9f..2d7fcd6 100644 (file)
@@ -1374,6 +1374,35 @@ exit:
        return rc;
 }
 
+int
+qed_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn,
+                             u8 *p_mac)
+{
+       struct qed_vf_iov *p_iov = p_hwfn->vf_iov_info;
+       struct vfpf_bulletin_update_mac_tlv *p_req;
+       struct pfvf_def_resp_tlv *p_resp;
+       int rc;
+
+       if (!p_mac)
+               return -EINVAL;
+
+       /* clear mailbox and prep header tlv */
+       p_req = qed_vf_pf_prep(p_hwfn, CHANNEL_TLV_BULLETIN_UPDATE_MAC,
+                              sizeof(*p_req));
+       ether_addr_copy(p_req->mac, p_mac);
+       DP_VERBOSE(p_hwfn, QED_MSG_IOV,
+                  "Requesting bulletin update for MAC[%pM]\n", p_mac);
+
+       /* add list termination tlv */
+       qed_add_tlv(p_hwfn, &p_iov->offset, CHANNEL_TLV_LIST_END,
+                   sizeof(struct channel_list_end_tlv));
+
+       p_resp = &p_iov->pf2vf_reply->default_resp;
+       rc = qed_send_msg2pf(p_hwfn, &p_resp->hdr.status, sizeof(*p_resp));
+       qed_vf_pf_req_end(p_hwfn, rc);
+       return rc;
+}
+
 int
 qed_vf_pf_set_coalesce(struct qed_hwfn *p_hwfn,
                       u16 rx_coal, u16 tx_coal, struct qed_queue_cid *p_cid)