#include "log.h"
/* shift the packet array by n places. */
static void batadv_bitmap_shift_left(unsigned long *seq_bits, s32 n)
{
if (n <= 0 || n >= BATADV_TQ_LOCAL_WINDOW_SIZE)
return;
bitmap_shift_left(seq_bits, seq_bits, n, BATADV_TQ_LOCAL_WINDOW_SIZE);
}
/**
* batadv_bit_get_packet - receive and process one packet within the sequence
* number window
* @priv: the bat priv with all the soft interface information
* @seq_bits: pointer to the sequence number receive packet
* @seq_num_diff: difference between the current/received sequence number and
* the last sequence number
* @set_mark: whether this packet should be marked in seq_bits
*
* Return: true if the window was moved (either new or very old),
* false if the window was not moved/shifted.
*/
bool batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
s32 seq_num_diff, int set_mark)
{
struct batadv_priv *bat_priv = priv;
/* sequence number is slightly older. We already got a sequence number
* higher than this one, so we just mark it.
*/
if (seq_num_diff <= 0 && seq_num_diff > -BATADV_TQ_LOCAL_WINDOW_SIZE) {
if (set_mark)
batadv_set_bit(seq_bits, -seq_num_diff);
return false;
}
/* sequence number is slightly newer, so we shift the window and
* set the mark if required
*/
if (seq_num_diff > 0 && seq_num_diff < BATADV_TQ_LOCAL_WINDOW_SIZE) {
batadv_bitmap_shift_left(seq_bits, seq_num_diff);
if (set_mark)
batadv_set_bit(seq_bits, 0);
return true;
}
/* sequence number is much newer, probably missed a lot of packets */
if (seq_num_diff >= BATADV_TQ_LOCAL_WINDOW_SIZE &&
seq_num_diff < BATADV_EXPECTED_SEQNO_RANGE) {
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"We missed a lot of packets (%i) !\n",
seq_num_diff - 1);
bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
if (set_mark)
batadv_set_bit(seq_bits, 0);
return true;
}
/* received a much older packet. The other host either restarted
* or the old packet got delayed somewhere in the network. The
* packet should be dropped without calling this function if the
* seqno window is protected.
*
* seq_num_diff <= -BATADV_TQ_LOCAL_WINDOW_SIZE
* or
* seq_num_diff >= BATADV_EXPECTED_SEQNO_RANGE
*/
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
"Other host probably restarted!\n");
bitmap_zero(seq_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
if (set_mark)
batadv_set_bit(seq_bits, 0);
return true;
}
f1ff40a06a2fd5eb221a81157'>ati_pcigart.h692 | logplain |
d--------- | bridge | 111 | logplain |
-rw-r--r-- | drmP.h | 25776 | logplain |
-rw-r--r-- | drm_agpsupport.h | 3867 | logplain |
-rw-r--r-- | drm_atomic.h | 14443 | logplain |
-rw-r--r-- | drm_atomic_helper.h | 10607 | logplain |
-rw-r--r-- | drm_auth.h | 2260 | logplain |
-rw-r--r-- | drm_blend.h | 2700 | logplain |
-rw-r--r-- | drm_bridge.h | 7977 | logplain |
-rw-r--r-- | drm_cache.h | 1763 | logplain |
-rw-r--r-- | drm_color_mgmt.h | 2166 | logplain |
-rw-r--r-- | drm_connector.h | 28975 | logplain |
-rw-r--r-- | drm_crtc.h | 28999 | logplain |
-rw-r--r-- | drm_crtc_helper.h | 3301 | logplain |
-rw-r--r-- | drm_debugfs_crc.h | 2670 | logplain |
-rw-r--r-- | drm_displayid.h | 2850 | logplain |
-rw-r--r-- | drm_dp_dual_mode_helper.h | 4532 | logplain |
-rw-r--r-- | drm_dp_helper.h | 30638 | logplain |
-rw-r--r-- | drm_dp_mst_helper.h | 16260 | logplain |
-rw-r--r-- | drm_drv.h | 14861 | logplain |
-rw-r--r-- | drm_edid.h | 14335 | logplain |
-rw-r--r-- | drm_encoder.h | 8160 | logplain |
-rw-r--r-- | drm_encoder_slave.h | 6583 | logplain |
-rw-r--r-- | drm_fb_cma_helper.h | 1929 | logplain |
-rw-r--r-- | drm_fb_helper.h | 15125 | logplain |
-rw-r--r-- | drm_fixed.h | 4825 | logplain |
-rw-r--r-- | drm_flip_work.h | 3071 | logplain |
-rw-r--r-- | drm_fourcc.h | 2748 | logplain |
-rw-r--r-- | drm_framebuffer.h | 9623 | logplain |
-rw-r--r-- | drm_gem.h | 8052 | logplain |
-rw-r--r-- | drm_gem_cma_helper.h | 2286 | logplain |
-rw-r--r-- | drm_global.h | 2011 | logplain |
-rw-r--r-- | drm_hashtab.h | 3139 | logplain |
-rw-r--r-- | drm_irq.h | 6323 | logplain |
-rw-r--r-- | drm_legacy.h | 6933 | logplain |
-rw-r--r-- | drm_mem_util.h | 2468 | logplain |
-rw-r--r-- | drm_mipi_dsi.h | 10327 | logplain |
-rw-r--r-- | drm_mm.h | 11462 | logplain |
-rw-r--r-- | drm_mode_config.h | 23728 | logplain |
-rw-r--r-- | drm_mode_object.h | 4911 | logplain |
-rw-r--r-- | drm_modes.h | 17078 | logplain |
-rw-r--r-- | drm_modeset_helper.h | 1576 | logplain |
-rw-r--r-- | drm_modeset_helper_vtables.h | 41180 | logplain |
-rw-r--r-- | drm_modeset_lock.h | 4241 | logplain |
-rw-r--r-- | drm_of.h | 2034 | logplain |
-rw-r--r-- | drm_os_linux.h | 2230 | logplain |
-rw-r--r-- | drm_panel.h | 7079 | logplain |
-rw-r--r-- | drm_pciids.h | 68035 | logplain |
-rw-r--r-- | drm_plane.h | 19435 | logplain |
-rw-r--r-- | drm_plane_helper.h | 3186 | logplain |
-rw-r--r-- | drm_print.h | 3232 | logplain |
-rw-r--r-- | drm_property.h | 11460 | logplain |
-rw-r--r-- | drm_rect.h | 5103 | logplain |
-rw-r--r-- | drm_simple_kms_helper.h | 4090 | logplain |
-rw-r--r-- | drm_sysfs.h | 300 | logplain |
-rw-r--r-- | drm_vma_manager.h | 7840 | logplain |
-rw-r--r-- | gma_drm.h | 1033 | logplain |
d--------- | i2c | 109 | logplain |