Changeset fdbc3ff in mainline for uspace/lib/c/generic/net/packet.c


Ignore:
Timestamp:
2010-11-19T23:50:06Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
46d4d9f
Parents:
b4c9c61 (diff), a9c6b966 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/net/packet.c

    rb4c9c61 rfdbc3ff  
    6464typedef packet_t packet_map_t[PACKET_MAP_SIZE];
    6565
    66 /** Type definition of the packet map page pointer. */
    67 typedef packet_map_t * packet_map_ref;
    68 
    6966/** Packet map.
    7067 * Maps packet identifiers to the packet references.
     
    8582/** Initializes the packet map.
    8683 *
    87  * @returns             EOK on success.
    88  * @returns             ENOMEM if there is not enough memory left.
     84 * @return              EOK on success.
     85 * @return              ENOMEM if there is not enough memory left.
    8986 */
    9087int pm_init(void)
     
    104101 *
    105102 * @param[in] packet_id The packet identifier to be found.
    106  * @returns             The found packet reference.
    107  * @returns             NULL if the mapping does not exist.
     103 * @return              The found packet reference.
     104 * @return              NULL if the mapping does not exist.
    108105 */
    109106packet_t pm_find(packet_id_t packet_id)
    110107{
    111         packet_map_ref map;
     108        packet_map_t *map;
    112109        packet_t packet;
    113110
     
    133130 *
    134131 * @param[in] packet    The packet to be remembered.
    135  * @returns             EOK on success.
    136  * @returns             EINVAL if the packet is not valid.
    137  * @returns             EINVAL if the packet map is not initialized.
    138  * @returns             ENOMEM if there is not enough memory left.
     132 * @return              EOK on success.
     133 * @return              EINVAL if the packet is not valid.
     134 * @return              EINVAL if the packet map is not initialized.
     135 * @return              ENOMEM if there is not enough memory left.
    139136 */
    140137int pm_add(packet_t packet)
    141138{
    142         packet_map_ref map;
     139        packet_map_t *map;
    143140        int rc;
    144141
     
    154151        } else {
    155152                do {
    156                         map = (packet_map_ref) malloc(sizeof(packet_map_t));
     153                        map = (packet_map_t *) malloc(sizeof(packet_map_t));
    157154                        if (!map) {
    158155                                fibril_rwlock_write_unlock(&pm_globals.lock);
     
    180177        int count;
    181178        int index;
    182         packet_map_ref map;
     179        packet_map_t *map;
    183180        packet_t packet;
    184181
     
    208205 * @param[in] order     The packet order value.
    209206 * @param[in] metric    The metric value of the packet.
    210  * @returns             EOK on success.
    211  * @returns             EINVAL if the first parameter is NULL.
    212  * @returns             EINVAL if the packet is not valid.
     207 * @return              EOK on success.
     208 * @return              EINVAL if the first parameter is NULL.
     209 * @return              EINVAL if the packet is not valid.
    213210 */
    214211int pq_add(packet_t * first, packet_t packet, size_t order, size_t metric)
     
    252249 * @param[in] first     The first packet of the queue.
    253250 * @param[in] order     The packet order value.
    254  * @returns             The packet with the given order.
    255  * @returns             NULL if the first packet is not valid.
    256  * @returns             NULL if the packet is not found.
     251 * @return              The packet with the given order.
     252 * @return              NULL if the first packet is not valid.
     253 * @return              NULL if the packet is not found.
    257254 */
    258255packet_t pq_find(packet_t packet, size_t order)
     
    278275 * @param[in] packet    The packet in the queue.
    279276 * @param[in] new_packet The new packet to be inserted.
    280  * @returns             EOK on success.
    281  * @returns             EINVAL if etiher of the packets is invalid.
     277 * @return              EOK on success.
     278 * @return              EINVAL if etiher of the packets is invalid.
    282279 */
    283280int pq_insert_after(packet_t packet, packet_t new_packet)
     
    301298 *
    302299 * @param[in] packet    The packet to be detached.
    303  * @returns             The next packet in the queue. If the packet is the first
     300 * @return              The next packet in the queue. If the packet is the first
    304301 *                      one of the queue, this becomes the new first one.
    305  * @returns             NULL if there is no packet left.
    306  * @returns             NULL if the packet is not valid.
     302 * @return              NULL if there is no packet left.
     303 * @return              NULL if the packet is not valid.
    307304 */
    308305packet_t pq_detach(packet_t packet)
     
    331328 * @param[in] order     The packet order value.
    332329 * @param[in] metric    The metric value of the packet.
    333  * @returns             EOK on success.
    334  * @returns             EINVAL if the packet is invalid.
     330 * @return              EOK on success.
     331 * @return              EINVAL if the packet is invalid.
    335332 */
    336333int pq_set_order(packet_t packet, size_t order, size_t metric)
     
    349346 * @param[out] order    The packet order value.
    350347 * @param[out] metric   The metric value of the packet.
    351  * @returns             EOK on success.
    352  * @returns             EINVAL if the packet is invalid.
     348 * @return              EOK on success.
     349 * @return              EINVAL if the packet is invalid.
    353350 */
    354351int pq_get_order(packet_t packet, size_t *order, size_t *metric)
     
    394391 *
    395392 * @param[in] packet    The packet queue member.
    396  * @returns             The next packet in the queue.
    397  * @returns             NULL if there is no next packet.
    398  * @returns             NULL if the packet is not valid.
     393 * @return              The next packet in the queue.
     394 * @return              NULL if there is no next packet.
     395 * @return              NULL if the packet is not valid.
    399396 */
    400397packet_t pq_next(packet_t packet)
     
    409406 *
    410407 * @param[in] packet    The packet queue member.
    411  * @returns             The previous packet in the queue.
    412  * @returns             NULL if there is no previous packet.
    413  * @returns             NULL if the packet is not valid.
     408 * @return              The previous packet in the queue.
     409 * @return              NULL if there is no previous packet.
     410 * @return              NULL if the packet is not valid.
    414411 */
    415412packet_t pq_previous(packet_t packet)
Note: See TracChangeset for help on using the changeset viewer.