~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/vxge/vxge-traffic.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
        return status;
219
219
}
220
220
 
 
221
void vxge_hw_vpath_tti_ci_set(struct __vxge_hw_fifo *fifo)
 
222
{
 
223
        struct vxge_hw_vpath_reg __iomem *vp_reg;
 
224
        struct vxge_hw_vp_config *config;
 
225
        u64 val64;
 
226
 
 
227
        if (fifo->config->enable != VXGE_HW_FIFO_ENABLE)
 
228
                return;
 
229
 
 
230
        vp_reg = fifo->vp_reg;
 
231
        config = container_of(fifo->config, struct vxge_hw_vp_config, fifo);
 
232
 
 
233
        if (config->tti.timer_ci_en != VXGE_HW_TIM_TIMER_CI_ENABLE) {
 
234
                config->tti.timer_ci_en = VXGE_HW_TIM_TIMER_CI_ENABLE;
 
235
                val64 = readq(&vp_reg->tim_cfg1_int_num[VXGE_HW_VPATH_INTR_TX]);
 
236
                val64 |= VXGE_HW_TIM_CFG1_INT_NUM_TIMER_CI;
 
237
                fifo->tim_tti_cfg1_saved = val64;
 
238
                writeq(val64, &vp_reg->tim_cfg1_int_num[VXGE_HW_VPATH_INTR_TX]);
 
239
        }
 
240
}
 
241
 
 
242
void vxge_hw_vpath_dynamic_rti_ci_set(struct __vxge_hw_ring *ring)
 
243
{
 
244
        u64 val64 = ring->tim_rti_cfg1_saved;
 
245
 
 
246
        val64 |= VXGE_HW_TIM_CFG1_INT_NUM_TIMER_CI;
 
247
        ring->tim_rti_cfg1_saved = val64;
 
248
        writeq(val64, &ring->vp_reg->tim_cfg1_int_num[VXGE_HW_VPATH_INTR_RX]);
 
249
}
 
250
 
 
251
void vxge_hw_vpath_dynamic_tti_rtimer_set(struct __vxge_hw_fifo *fifo)
 
252
{
 
253
        u64 val64 = fifo->tim_tti_cfg3_saved;
 
254
        u64 timer = (fifo->rtimer * 1000) / 272;
 
255
 
 
256
        val64 &= ~VXGE_HW_TIM_CFG3_INT_NUM_RTIMER_VAL(0x3ffffff);
 
257
        if (timer)
 
258
                val64 |= VXGE_HW_TIM_CFG3_INT_NUM_RTIMER_VAL(timer) |
 
259
                        VXGE_HW_TIM_CFG3_INT_NUM_RTIMER_EVENT_SF(5);
 
260
 
 
261
        writeq(val64, &fifo->vp_reg->tim_cfg3_int_num[VXGE_HW_VPATH_INTR_TX]);
 
262
        /* tti_cfg3_saved is not updated again because it is
 
263
         * initialized at one place only - init time.
 
264
         */
 
265
}
 
266
 
 
267
void vxge_hw_vpath_dynamic_rti_rtimer_set(struct __vxge_hw_ring *ring)
 
268
{
 
269
        u64 val64 = ring->tim_rti_cfg3_saved;
 
270
        u64 timer = (ring->rtimer * 1000) / 272;
 
271
 
 
272
        val64 &= ~VXGE_HW_TIM_CFG3_INT_NUM_RTIMER_VAL(0x3ffffff);
 
273
        if (timer)
 
274
                val64 |= VXGE_HW_TIM_CFG3_INT_NUM_RTIMER_VAL(timer) |
 
275
                        VXGE_HW_TIM_CFG3_INT_NUM_RTIMER_EVENT_SF(4);
 
276
 
 
277
        writeq(val64, &ring->vp_reg->tim_cfg3_int_num[VXGE_HW_VPATH_INTR_RX]);
 
278
        /* rti_cfg3_saved is not updated again because it is
 
279
         * initialized at one place only - init time.
 
280
         */
 
281
}
 
282
 
221
283
/**
222
284
 * vxge_hw_channel_msix_mask - Mask MSIX Vector.
223
285
 * @channeh: Channel for rx or tx handle
254
316
}
255
317
 
256
318
/**
 
319
 * vxge_hw_channel_msix_clear - Unmask the MSIX Vector.
 
320
 * @channel: Channel for rx or tx handle
 
321
 * @msix_id:  MSI ID
 
322
 *
 
323
 * The function unmasks the msix interrupt for the given msix_id
 
324
 * if configured in MSIX oneshot mode
 
325
 *
 
326
 * Returns: 0
 
327
 */
 
328
void vxge_hw_channel_msix_clear(struct __vxge_hw_channel *channel, int msix_id)
 
329
{
 
330
        __vxge_hw_pio_mem_write32_upper(
 
331
                (u32) vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
 
332
                &channel->common_reg->clr_msix_one_shot_vec[msix_id % 4]);
 
333
}
 
334
 
 
335
/**
257
336
 * vxge_hw_device_set_intr_type - Updates the configuration
258
337
 *              with new interrupt type.
259
338
 * @hldev: HW device handle.
1032
1111
 * vxge_hw_channel_dtr_count
1033
1112
 * @channel: Channel handle. Obtained via vxge_hw_channel_open().
1034
1113
 *
1035
 
 * Retreive number of DTRs available. This function can not be called
 
1114
 * Retrieve number of DTRs available. This function can not be called
1036
1115
 * from data path. ring_initial_replenishi() is the only user.
1037
1116
 */
1038
1117
int vxge_hw_channel_dtr_count(struct __vxge_hw_channel *channel)
1981
2060
 
1982
2061
        vpath = vp->vpath;
1983
2062
 
1984
 
        /* Enable promiscous mode for function 0 only */
 
2063
        /* Enable promiscuous mode for function 0 only */
1985
2064
        if (!(vpath->hldev->access_rights &
1986
2065
                VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM))
1987
2066
                return VXGE_HW_OK;
2191
2270
        if (vpath->hldev->config.intr_mode ==
2192
2271
                                        VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) {
2193
2272
                __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(
 
2273
                                VXGE_HW_ONE_SHOT_VECT0_EN_ONE_SHOT_VECT0_EN,
 
2274
                                0, 32), &vp_reg->one_shot_vect0_en);
 
2275
                __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(
2194
2276
                                VXGE_HW_ONE_SHOT_VECT1_EN_ONE_SHOT_VECT1_EN,
2195
2277
                                0, 32), &vp_reg->one_shot_vect1_en);
2196
 
        }
2197
 
 
2198
 
        if (vpath->hldev->config.intr_mode ==
2199
 
                VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) {
2200
2278
                __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(
2201
2279
                                VXGE_HW_ONE_SHOT_VECT2_EN_ONE_SHOT_VECT2_EN,
2202
2280
                                0, 32), &vp_reg->one_shot_vect2_en);
2203
 
 
2204
 
                __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(
2205
 
                                VXGE_HW_ONE_SHOT_VECT3_EN_ONE_SHOT_VECT3_EN,
2206
 
                                0, 32), &vp_reg->one_shot_vect3_en);
2207
2281
        }
2208
2282
}
2209
2283
 
2229
2303
}
2230
2304
 
2231
2305
/**
 
2306
 * vxge_hw_vpath_msix_clear - Clear MSIX Vector.
 
2307
 * @vp: Virtual Path handle.
 
2308
 * @msix_id:  MSI ID
 
2309
 *
 
2310
 * The function clears the msix interrupt for the given msix_id
 
2311
 *
 
2312
 * Returns: 0,
 
2313
 * Otherwise, VXGE_HW_ERR_WRONG_IRQ if the msix index is out of range
 
2314
 * status.
 
2315
 * See also:
 
2316
 */
 
2317
void vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vp, int msix_id)
 
2318
{
 
2319
        struct __vxge_hw_device *hldev = vp->vpath->hldev;
 
2320
 
 
2321
        if ((hldev->config.intr_mode == VXGE_HW_INTR_MODE_MSIX_ONE_SHOT))
 
2322
                __vxge_hw_pio_mem_write32_upper(
 
2323
                        (u32) vxge_bVALn(vxge_mBIT((msix_id >> 2)), 0, 32),
 
2324
                        &hldev->common_reg->clr_msix_one_shot_vec[msix_id % 4]);
 
2325
        else
 
2326
                __vxge_hw_pio_mem_write32_upper(
 
2327
                        (u32) vxge_bVALn(vxge_mBIT((msix_id >> 2)), 0, 32),
 
2328
                        &hldev->common_reg->clear_msix_mask_vect[msix_id % 4]);
 
2329
}
 
2330
 
 
2331
/**
2232
2332
 * vxge_hw_vpath_msix_unmask - Unmask the MSIX Vector.
2233
2333
 * @vp: Virtual Path handle.
2234
2334
 * @msix_id:  MSI ID