[processor-sdk/pdk.git] / packages / ti / drv / sciclient / soc / sysfw / binaries / system-firmware-public-documentation / 2_tisci_msgs / security / firewall_api.html
3 <!DOCTYPE html>
4 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
5 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
6 <head>
7 <meta charset="utf-8">
9 <meta name="viewport" content="width=device-width, initial-scale=1.0">
11 <title>Firewall TISCI Description — TISCI User Guide</title>
16 <link rel="shortcut icon" href="../../_static/favicon.ico"/>
29 <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
33 <link rel="stylesheet" href="../../_static/theme_overrides.css" type="text/css" />
37 <link rel="index" title="Index"
38 href="../../genindex.html"/>
39 <link rel="search" title="Search" href="../../search.html"/>
40 <link rel="top" title="TISCI User Guide" href="../../index.html"/>
41 <link rel="up" title="Chapter 2: TISCI Message Documentation" href="../index.html"/>
42 <link rel="next" title="Secure AP Command Interface" href="sec_ap_data_transfer.html"/>
43 <link rel="prev" title="Processor Boot Management TISCI Description" href="PROC_BOOT.html"/>
46 <script src="../../_static/js/modernizr.min.js"></script>
48 </head>
50 <body class="wy-body-for-nav" role="document">
51 <header id="tiHeader">
52 <div class="top">
53 <ul>
54 <li id="top_logo">
55 <a href="http://www.ti.com">
56 <img src="../../_static/img/ti_logo.png"/>
57 </a>
58 </li>
59 </ul>
60 </div>
61 <div class="nav"></div>
62 </header>
63 <div class="wy-grid-for-nav">
66 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
67 <div class="wy-side-scroll">
68 <div class="wy-side-nav-search">
72 <a href="../../index.html" class="icon icon-home"> TISCI
76 </a>
81 <div class="version">
82 20.00.00
83 </div>
88 <div role="search">
89 <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
90 <input type="text" name="q" placeholder="Search docs" />
91 <input type="hidden" name="check_keywords" value="yes" />
92 <input type="hidden" name="area" value="default" />
93 </form>
94 </div>
97 </div>
99 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
103 <ul class="current">
104 <li class="toctree-l1"><a class="reference internal" href="../../1_intro/index.html">Chapter 1: Introduction</a></li>
105 <li class="toctree-l1 current"><a class="reference internal" href="../index.html">Chapter 2: TISCI Message Documentation</a><ul class="current">
106 <li class="toctree-l2"><a class="reference internal" href="../general/TISCI_header.html">Texas Instruments System Controller Interface (TISCI)</a></li>
107 <li class="toctree-l2"><a class="reference internal" href="../index.html#general">General</a></li>
108 <li class="toctree-l2"><a class="reference internal" href="../index.html#power-management-pm">Power Management (PM)</a></li>
109 <li class="toctree-l2"><a class="reference internal" href="../index.html#resource-management-rm">Resource Management (RM)</a></li>
110 <li class="toctree-l2 current"><a class="reference internal" href="../index.html#secure-management">Secure Management</a><ul class="current">
111 <li class="toctree-l3"><a class="reference internal" href="sec_cert_format.html">Security X509 Certificate Documentation</a></li>
112 <li class="toctree-l3"><a class="reference internal" href="PROC_BOOT.html">Processor Boot Management TISCI Description</a></li>
113 <li class="toctree-l3 current"><a class="current reference internal" href="#">Firewall TISCI Description</a><ul>
114 <li class="toctree-l4"><a class="reference internal" href="#background-information">Background Information</a></li>
115 <li class="toctree-l4"><a class="reference internal" href="#initial-configuration">Initial Configuration</a></li>
116 <li class="toctree-l4"><a class="reference internal" href="#api-description">API Description</a></li>
117 </ul>
118 </li>
119 <li class="toctree-l3"><a class="reference internal" href="sec_ap_data_transfer.html">Secure AP Command Interface</a></li>
120 <li class="toctree-l3"><a class="reference internal" href="runtime_debug.html">Runtime Debug TISCI Description</a></li>
121 <li class="toctree-l3"><a class="reference internal" href="extended_otp.html">Extended OTP TISCI Description</a></li>
122 <li class="toctree-l3"><a class="reference internal" href="dkek_management.html">Derived KEK TISCI Description</a></li>
123 <li class="toctree-l3"><a class="reference internal" href="security_handover.html">Security Handover Message Description</a></li>
124 </ul>
125 </li>
126 </ul>
127 </li>
128 <li class="toctree-l1"><a class="reference internal" href="../../3_boardcfg/index.html">Chapter 3: Board Configuration</a></li>
129 <li class="toctree-l1"><a class="reference internal" href="../../4_trace/index.html">Chapter 4: Interpreting Trace Data</a></li>
130 <li class="toctree-l1"><a class="reference internal" href="../../5_soc_doc/index.html">Chapter 5: SoC Family Specific Documentation</a></li>
131 <li class="toctree-l1"><a class="reference internal" href="../../6_topic_user_guides/index.html">Chapter 6: Topic User Guides</a></li>
132 </ul>
136 </div>
137 </div>
138 </nav>
140 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
143 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
144 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
145 <a href="../../index.html">TISCI</a>
146 </nav>
150 <div class="wy-nav-content">
151 <div class="rst-content">
158 <div role="navigation" aria-label="breadcrumbs navigation">
159 <ul class="wy-breadcrumbs">
160 <li><a href="../../index.html">Docs</a> »</li>
162 <li><a href="../index.html">Chapter 2: TISCI Message Documentation</a> »</li>
164 <li>Firewall TISCI Description</li>
165 <li class="wy-breadcrumbs-aside">
169 </li>
170 </ul>
171 <hr/>
172 </div>
173 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
174 <div itemprop="articleBody">
176 <div class="section" id="firewall-tisci-description">
177 <h1>Firewall TISCI Description<a class="headerlink" href="#firewall-tisci-description" title="Permalink to this headline">¶</a></h1>
178 <p id="sec-ap-fwl-tisci-desc">This chapter provides information on Firewall API’s provided by system firmware.
179 There are three firewall API as listed below.</p>
180 <table border="1" class="docutils">
181 <colgroup>
182 <col width="23%" />
183 <col width="77%" />
184 </colgroup>
185 <thead valign="bottom">
186 <tr class="row-odd"><th class="head">TISCI Message ID</th>
187 <th class="head">Message Name</th>
188 </tr>
189 </thead>
190 <tbody valign="top">
191 <tr class="row-even"><td>0x9000</td>
192 <td><a class="reference internal" href="#set-firewall-region"><span class="std std-ref">TISCI_MSG_SET_FWL_REGION</span></a>.</td>
193 </tr>
194 <tr class="row-odd"><td>0x9001</td>
195 <td><a class="reference internal" href="#get-firewall-region"><span class="std std-ref">TISCI_MSG_GET_FWL_REGION</span></a>.</td>
196 </tr>
197 <tr class="row-even"><td>0x9002</td>
198 <td><a class="reference internal" href="#change-firewall-owner"><span class="std std-ref">TISCI_MSG_CHANGE_FWL_OWNER</span></a>.</td>
199 </tr>
200 </tbody>
201 </table>
202 <div class="section" id="background-information">
203 <h2>Background Information<a class="headerlink" href="#background-information" title="Permalink to this headline">¶</a></h2>
204 <p>Each firewall in the system is assigned an owner. Ownership is
205 assigned using <cite>Host ID</cite>. Only a owner of a firewall can</p>
206 <ul class="simple">
207 <li>Configure the firewall permissions</li>
208 <li>Query the firewall permissions</li>
209 <li>Transfer the firewall ownership to another owner(host)</li>
210 </ul>
211 </div>
212 <div class="section" id="initial-configuration">
213 <h2>Initial Configuration<a class="headerlink" href="#initial-configuration" title="Permalink to this headline">¶</a></h2>
214 <p>System firmware configures the firewalls in the following manner on startup.</p>
215 <ol class="arabic simple">
216 <li>DMSC internal memories are firewalled. Firewall ownership is assigned to DMSC.</li>
217 <li>Secure proxy and associated resources required for DMSC operation are
218 firewalled. Firewall ownership is assigned to DMSC.</li>
219 <li>All Navss resources not used by DMSC are firewalled and ownership of the
220 firewalls is assigned to Resource Manager(RM). The intent is that RM programs
221 the firewalls for Navss resources based on resource assignment in board
222 configuration.</li>
223 </ol>
224 </div>
225 <div class="section" id="api-description">
226 <h2>API Description<a class="headerlink" href="#api-description" title="Permalink to this headline">¶</a></h2>
227 <div class="section" id="tisci-msg-set-fwl-region-set-firewall-region">
228 <span id="set-firewall-region"></span><h3>TISCI_MSG_SET_FWL_REGION - Set Firewall region<a class="headerlink" href="#tisci-msg-set-fwl-region-set-firewall-region" title="Permalink to this headline">¶</a></h3>
229 <p><strong>Usage</strong>:</p>
230 <table border="1" class="docutils">
231 <colgroup>
232 <col width="75%" />
233 <col width="25%" />
234 </colgroup>
235 <tbody valign="top">
236 <tr class="row-odd"><td><strong>Message Type</strong></td>
237 <td>Normal</td>
238 </tr>
239 <tr class="row-even"><td><strong>Secure Queue Only?</strong></td>
240 <td>No</td>
241 </tr>
242 </tbody>
243 </table>
244 </div>
245 <div class="section" id="tisci-message-id">
246 <h3>TISCI Message ID<a class="headerlink" href="#tisci-message-id" title="Permalink to this headline">¶</a></h3>
247 <p><p><code class="docutils literal"><span class="pre">TISCI_MSG_SET_FWL_REGION</span>          <span class="pre">(0x9000U)</span></code></p>
248 <p>Message to set a firewall region configuration</p>
249 </p>
250 <p><p><strong>struct tisci_msg_fwl_set_firewall_region_req</strong></p>
251 <p>Request for configuring the firewall permissions.</p>
252 <table border="1" class="docutils">
253 <colgroup>
254 <col width="5%" />
255 <col width="6%" />
256 <col width="90%" />
257 </colgroup>
258 <thead valign="bottom">
259 <tr class="row-odd"><th class="head">Parameter</th>
260 <th class="head">Type</th>
261 <th class="head">Description</th>
262 </tr>
263 </thead>
264 <tbody valign="top">
265 <tr class="row-even"><td>hdr</td>
266 <td>struct tisci_header</td>
267 <td>Common TI-SCI header</td>
268 </tr>
269 <tr class="row-odd"><td>fwl_id</td>
270 <td>u16</td>
271 <td>firewall ID in question. fwl_id is defined in the TRM.</td>
272 </tr>
273 <tr class="row-even"><td>region</td>
274 <td>u16</td>
275 <td>Region or channel number to set config info This field is unused in case of a simple firewall and must be initialized to zero. In case of a region based firewall, this field indicates the region in question. (index starting from 0) In case of a channel based firewall, this field indicates the channel in question (index starting from 0)</td>
276 </tr>
277 <tr class="row-odd"><td>n_permission_regs</td>
278 <td>u32</td>
279 <td>Number of permission registers to set</td>
280 </tr>
281 <tr class="row-even"><td>control</td>
282 <td>u32</td>
283 <td>Contents of the firewall CONTROL register to set</td>
284 </tr>
285 <tr class="row-odd"><td>permissions</td>
286 <td>u32</td>
287 <td>Contents of the firewall PERMISSION register to set</td>
288 </tr>
289 <tr class="row-even"><td>start_address</td>
290 <td>soc_phys_addr_t</td>
291 <td>Contents of the firewall START_ADDRESS register to set</td>
292 </tr>
293 <tr class="row-odd"><td>end_address</td>
294 <td>soc_phys_addr_t</td>
295 <td>Contents of the firewall END_ADDRESS register to set</td>
296 </tr>
297 </tbody>
298 </table>
299 </p>
300 <p><p><strong>struct tisci_msg_fwl_set_firewall_region_resp</strong></p>
301 <p>Response for configuring the firewall permissions.</p>
302 <table border="1" class="docutils">
303 <colgroup>
304 <col width="7%" />
305 <col width="11%" />
306 <col width="83%" />
307 </colgroup>
308 <thead valign="bottom">
309 <tr class="row-odd"><th class="head">Parameter</th>
310 <th class="head">Type</th>
311 <th class="head">Description</th>
312 </tr>
313 </thead>
314 <tbody valign="top">
315 <tr class="row-even"><td>hdr</td>
316 <td>struct tisci_header</td>
317 <td>Generic TISCI message header. ACK response indicates that firewall configuration is succesful. NACK response indicates that the configuration was not performed.</td>
318 </tr>
319 </tbody>
320 </table>
321 </p>
322 </div>
323 <div class="section" id="tisci-msg-get-fwl-region-get-firewall-region">
324 <span id="get-firewall-region"></span><h3>TISCI_MSG_GET_FWL_REGION - Get Firewall region<a class="headerlink" href="#tisci-msg-get-fwl-region-get-firewall-region" title="Permalink to this headline">¶</a></h3>
325 <p><strong>Usage</strong>:</p>
326 <table border="1" class="docutils">
327 <colgroup>
328 <col width="75%" />
329 <col width="25%" />
330 </colgroup>
331 <tbody valign="top">
332 <tr class="row-odd"><td><strong>Message Type</strong></td>
333 <td>Normal</td>
334 </tr>
335 <tr class="row-even"><td><strong>Secure Queue Only?</strong></td>
336 <td>No</td>
337 </tr>
338 </tbody>
339 </table>
340 </div>
341 <div class="section" id="id1">
342 <h3>TISCI Message ID<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
343 <p><p><code class="docutils literal"><span class="pre">TISCI_MSG_GET_FWL_REGION</span>          <span class="pre">(0x9001U)</span></code></p>
344 <p>Message to get a firewall region configuration</p>
345 </p>
346 <p><p><strong>struct tisci_msg_fwl_get_firewall_region_req</strong></p>
347 <p>Request for retrieving the firewall permissions.</p>
348 <table border="1" class="docutils">
349 <colgroup>
350 <col width="20%" />
351 <col width="22%" />
352 <col width="58%" />
353 </colgroup>
354 <thead valign="bottom">
355 <tr class="row-odd"><th class="head">Parameter</th>
356 <th class="head">Type</th>
357 <th class="head">Description</th>
358 </tr>
359 </thead>
360 <tbody valign="top">
361 <tr class="row-even"><td>hdr</td>
362 <td>struct tisci_header</td>
363 <td>Generic TISCI message header.</td>
364 </tr>
365 <tr class="row-odd"><td>fwl_id</td>
366 <td>u16</td>
367 <td>firewall ID in question. fwl_id is defined in the TRM.</td>
368 </tr>
369 <tr class="row-even"><td>region</td>
370 <td>u16</td>
371 <td>Region or channel number to set config info</td>
372 </tr>
373 <tr class="row-odd"><td>n_permission_regs</td>
374 <td>u32</td>
375 <td>Number of permission registers to retrieve</td>
376 </tr>
377 </tbody>
378 </table>
379 <p>This field is unused in case of a simple firewall and must be initialized
380 to zero. In case of a region based firewall, this field indicates the
381 region in question (index starting from 0). In case of a channel based
382 firewall, this field indicates the channel in question (index starting
383 from 0).</p>
384 </p>
385 <p><p><strong>struct tisci_msg_fwl_get_firewall_region_resp</strong></p>
386 <p>Response for retrieving the firewall permissions.</p>
387 <table border="1" class="docutils">
388 <colgroup>
389 <col width="5%" />
390 <col width="6%" />
391 <col width="90%" />
392 </colgroup>
393 <thead valign="bottom">
394 <tr class="row-odd"><th class="head">Parameter</th>
395 <th class="head">Type</th>
396 <th class="head">Description</th>
397 </tr>
398 </thead>
399 <tbody valign="top">
400 <tr class="row-even"><td>hdr</td>
401 <td>struct tisci_header</td>
402 <td>Generic TISCI message header. A ACK response in the hdr indicates that the message was processed. successfully. A NACK response indicates failure to retrieve firewall permissions.</td>
403 </tr>
404 <tr class="row-odd"><td>fwl_id</td>
405 <td>u16</td>
406 <td>firewall ID in question. fwl_id is defined in the TRM.</td>
407 </tr>
408 <tr class="row-even"><td>region</td>
409 <td>u16</td>
410 <td>Region or channel number to set config info This field is unused in case of a simple firewall and must be initialized to zero. In case of a region based firewall, this field indicates the region in question. (index starting from 0) In case of a channel based firewall, this field indicates the channel in question (index starting from 0)</td>
411 </tr>
412 <tr class="row-odd"><td>n_permission_regs</td>
413 <td>u32</td>
414 <td>Number of permission registers retrieved</td>
415 </tr>
416 <tr class="row-even"><td>control</td>
417 <td>u32</td>
418 <td>Contents of the firewall CONTROL register</td>
419 </tr>
420 <tr class="row-odd"><td>permissions</td>
421 <td>u32</td>
422 <td>Contents of the firewall PERMISSION registers</td>
423 </tr>
424 <tr class="row-even"><td>start_address</td>
425 <td>soc_phys_addr_t</td>
426 <td>Contents of the firewall START_ADDRESS register This is not applicable for channelized firewalls.</td>
427 </tr>
428 <tr class="row-odd"><td>end_address</td>
429 <td>soc_phys_addr_t</td>
430 <td>Contents of the firewall END_ADDRESS register This is not applicable for channelized firewalls.</td>
431 </tr>
432 </tbody>
433 </table>
434 </p>
435 </div>
436 <div class="section" id="tisci-msg-change-fwl-owner-change-firewall-owner">
437 <span id="change-firewall-owner"></span><h3>TISCI_MSG_CHANGE_FWL_OWNER - Change Firewall Owner<a class="headerlink" href="#tisci-msg-change-fwl-owner-change-firewall-owner" title="Permalink to this headline">¶</a></h3>
438 <p><strong>Usage</strong>:</p>
439 <table border="1" class="docutils">
440 <colgroup>
441 <col width="75%" />
442 <col width="25%" />
443 </colgroup>
444 <tbody valign="top">
445 <tr class="row-odd"><td><strong>Message Type</strong></td>
446 <td>Normal</td>
447 </tr>
448 <tr class="row-even"><td><strong>Secure Queue Only?</strong></td>
449 <td>No</td>
450 </tr>
451 </tbody>
452 </table>
453 </div>
454 <div class="section" id="id2">
455 <h3>TISCI Message ID<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
456 <p><p><code class="docutils literal"><span class="pre">TISCI_MSG_CHANGE_FWL_OWNER</span>          <span class="pre">(0x9002U)</span></code></p>
457 <p>Message to change firewall region owner</p>
458 </p>
459 <p><p><strong>struct tisci_msg_fwl_change_owner_info_req</strong></p>
460 <p>Request for a change owner operation</p>
461 <table border="1" class="docutils">
462 <colgroup>
463 <col width="17%" />
464 <col width="28%" />
465 <col width="55%" />
466 </colgroup>
467 <thead valign="bottom">
468 <tr class="row-odd"><th class="head">Parameter</th>
469 <th class="head">Type</th>
470 <th class="head">Description</th>
471 </tr>
472 </thead>
473 <tbody valign="top">
474 <tr class="row-even"><td>hdr</td>
475 <td>struct tisci_header</td>
476 <td>Common TI-SCI header</td>
477 </tr>
478 <tr class="row-odd"><td>fwl_id</td>
479 <td>u16</td>
480 <td>firewall ID in question</td>
481 </tr>
482 <tr class="row-even"><td>region</td>
483 <td>u16</td>
484 <td>Region or channel number if applicable</td>
485 </tr>
486 <tr class="row-odd"><td>owner_index</td>
487 <td>u8</td>
488 <td>New owner index to transfer ownership to</td>
489 </tr>
490 </tbody>
491 </table>
492 </p>
493 <p><p><strong>struct tisci_msg_fwl_change_owner_info_resp</strong></p>
494 <p>Response for a change owner operation</p>
495 <table border="1" class="docutils">
496 <colgroup>
497 <col width="12%" />
498 <col width="11%" />
499 <col width="77%" />
500 </colgroup>
501 <thead valign="bottom">
502 <tr class="row-odd"><th class="head">Parameter</th>
503 <th class="head">Type</th>
504 <th class="head">Description</th>
505 </tr>
506 </thead>
507 <tbody valign="top">
508 <tr class="row-even"><td>hdr</td>
509 <td>struct tisci_header</td>
510 <td>Common TI-SCI header ACK response indicates that change owner operation is succesful. NACK response indicates that change owner operation failed.</td>
511 </tr>
512 <tr class="row-odd"><td>fwl_id</td>
513 <td>u16</td>
514 <td>firewall ID specified in request</td>
515 </tr>
516 <tr class="row-even"><td>region</td>
517 <td>u16</td>
518 <td>Region or channel number specified in request</td>
519 </tr>
520 <tr class="row-odd"><td>owner_index</td>
521 <td>u8</td>
522 <td>owner index specified in request</td>
523 </tr>
524 <tr class="row-even"><td>owner_privid</td>
525 <td>u8</td>
526 <td>new owner priv-ID returned by DMSC. This field is currently initialized to zero by DMSC.</td>
527 </tr>
528 <tr class="row-odd"><td>owner_permission_bits</td>
529 <td>u16</td>
530 <td>new owner permission bits returned by DMSC. This field is currently initialized to zero by DMSC.</td>
531 </tr>
532 </tbody>
533 </table>
534 </p>
535 </div>
536 </div>
537 </div>
540 </div>
541 </div>
542 <footer>
544 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
546 <a href="sec_ap_data_transfer.html" class="btn btn-neutral float-right" title="Secure AP Command Interface" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
549 <a href="PROC_BOOT.html" class="btn btn-neutral" title="Processor Boot Management TISCI Description" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
551 </div>
554 <hr/>
556 <div role="contentinfo">
557 <p>
558 <a href="http://www.ti.com/corp/docs/legal/copyright.shtml">© Copyright 2016-2020</a>, Texas Instruments Incorporated. All rights reserved. <br>
559 <a href="http://www.ti.com/corp/docs/legal/trademark/trademrk.htm">Trademarks</a> | <a href="http://www.ti.com/corp/docs/legal/privacy.shtml">Privacy policy</a> | <a href="http://www.ti.com/corp/docs/legal/termsofuse.shtml">Terms of use</a> | <a href="http://www.ti.com/lsds/ti/legal/termsofsale.page">Terms of sale</a>
561 </p>
562 </div>
564 </footer>
566 </div>
567 </div>
569 </section>
571 </div>
577 <script type="text/javascript">
578 var DOCUMENTATION_OPTIONS = {
579 URL_ROOT:'../../',
580 VERSION:'20.00.00',
581 COLLAPSE_INDEX:false,
582 FILE_SUFFIX:'.html',
583 HAS_SOURCE: true
584 };
585 </script>
586 <script type="text/javascript" src="../../_static/jquery.js"></script>
587 <script type="text/javascript" src="../../_static/underscore.js"></script>
588 <script type="text/javascript" src="../../_static/doctools.js"></script>
589 <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
591 <script src="http://www.ti.com/assets/js/headerfooter/analytics.js" type="text/javascript" charset="utf-8"></script>
597 <script type="text/javascript" src="../../_static/js/theme.js"></script>
602 <script type="text/javascript">
603 jQuery(function () {
604 SphinxRtdTheme.StickyNav.enable();
605 });
607 var menuHeight = window.innerHeight;
609 var contentOffset = $(".wy-nav-content-wrap").offset();
610 var contentHeight = $(".wy-nav-content-wrap").height();
611 var contentBottom = contentOffset.top + contentHeight;
613 function setNavbarTop() {
614 var scrollTop = $(window).scrollTop();
615 var maxTop = scrollTop + menuHeight;
617 // If past the header
618 if (scrollTop > contentOffset.top && maxTop < contentBottom) {
619 stickyTop = scrollTop - contentOffset.top;
620 } else if (maxTop > contentBottom) {
621 stickyTop = scrollTop - contentOffset.top - (maxTop - contentBottom);
622 } else {
623 stickyTop = 0;
624 }
626 $(".wy-nav-side").css("top", stickyTop);
627 }
629 $(document).ready(function() {
630 setNavbarTop();
631 $(window).scroll(function () {
632 setNavbarTop();
633 });
635 $('body').on("mousewheel", function () {
636 // Remove default behavior
637 event.preventDefault();
638 // Scroll without smoothing
639 var wheelDelta = event.wheelDelta;
640 var currentScrollPosition = window.pageYOffset;
641 window.scrollTo(0, currentScrollPosition - wheelDelta);
642 });
643 });
644 </script>
647 </body>
648 </html>