Changeset 1bc35b5 in mainline for uspace/lib/nic/src/nic_rx_control.c


Ignore:
Timestamp:
2012-01-19T08:13:45Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d8da56b
Parents:
3ea725e
Message:

Remove most use of packet_t from NIC drivers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/nic/src/nic_rx_control.c

    r3ea725e r1bc35b5  
    392392 *
    393393 * @param rxc
    394  * @param packet        The probed frame
     394 * @param frame     The probed frame
    395395 *
    396396 * @return True if the frame passes, false if it does not
    397397 */
    398 int nic_rxc_check(const nic_rxc_t *rxc, const packet_t *packet,
     398int nic_rxc_check(const nic_rxc_t *rxc, const void *data, size_t size,
    399399        nic_frame_type_t *frame_type)
    400400{
    401401        assert(frame_type != NULL);
    402         uint8_t *dest_addr = (uint8_t *) packet + packet->data_start;
     402        uint8_t *dest_addr = (uint8_t *) data;
    403403        uint8_t *src_addr = dest_addr + ETH_ADDR;
     404
     405        if (size < 2 * ETH_ADDR)
     406                return false;
    404407
    405408        if (dest_addr[0] & 1) {
     
    448451        if (!rxc->vlan_exact && rxc->vlan_mask != NULL) {
    449452                vlan_header_t *vlan_header = (vlan_header_t *)
    450                         ((uint8_t *) packet + packet->data_start + 2 * ETH_ADDR);
     453                        ((uint8_t *) data + 2 * ETH_ADDR);
    451454                if (vlan_header->tpid_upper == VLAN_TPID_UPPER &&
    452455                        vlan_header->tpid_lower == VLAN_TPID_LOWER) {
Note: See TracChangeset for help on using the changeset viewer.